Javascript for checking 404/500 pages/all links are clickable through - javascript

I've started using new tool,GI, for automated testing, and ill need to make javascript for testing the website's links, if they are clickable through, and there are no 404/500 pages on website. Ideally script should just include javascript code and be as simple as possible. Thank you in advance for help!

Related

I want edit every single page in wordpress. Is possible?

Sorry if this question sounds stupid but im a noob with wordpress.
I am a javascript developer, and I want make a little game (or games) with wordpress. Opening main page there is a sliding puzzle. After complete, a button appears and clicking there you pass to another page. This is basically the same to all pages.
But I can't find were i put my javascript or HTML code. I create the pages but I can't edit them the way I want, everytime i try to do it i only can edit like word. I cant create, change or edit divs attibutes or tags. To be honest the only thing i can edit is CSS in stylesheet, but is too limited.
I have done the search, try found a solutions or ways to done it but when i look to tutorials is all diferent from what i see.
to give you an ideia I want to do a mix of this:
-> http://www.rustylake.com/room-escape-games/cube-escape-case-23.html
and this
-> https://ebonyriddle.com/
but i don't know how to edit page to page.
can you help me?
Thanks for everything
PS: I know I can do it without Wordpress, but I want use it anyway to learn more about the CMS (because of work) maintain website structure and later learn how to do my own templates or plugins.
To answer your question directly, yes it is possible (and easy, relatively speaking) to add custom code to every page / post of a Wordpress site.
More generally, you’re talking about creating a custom Wordpress theme, which you can find out more about here:
https://codex.wordpress.org/Theme_Development
and here:
https://developer.wordpress.org/themes/getting-started/ (Good suggestion from #ItsGeorge)
Regarding adding custom JavaScript to a theme, your files will need to be enqueued as per these instructions.
Outlining the steps involved in Wordpress theme development would go beyond the scope of your question, but there are plenty of resources online and answers to Wordpress specific questions on wordpress.stackexchange.com. You will need to familiarise yourself with php as well as JavaScript, to take full control of Wordpress.
I would say that developing a game feels like an odd fit... If learning Wordpress is your objective, a blog or personal website might be a better place to start, then you could move onto a game once you are familiar with the concepts involved, e.g. the loop, which plays a huge part in how Wordpress works
Good luck!
The primary focus of WordPress is to put HTML code and JS out of the user. You might manage your extra JavaScript files with your theme customization. If you want to get more control about how your pages are rendering, you should use action hooks and filters. The simplest way for you is to override each page template like this
https://developer.wordpress.org/themes/basics/template-hierarchy/#single-page
The preferable resource to ask Wordpress related questions is https://wordpress.stackexchange.com/

how can I create widget with nodejs - add script to webpage

I'm looking ways to create nodejs widget for websites, where users will implement script tag on webpage and widget will be loaded?
hoping to get guidance, idea to start small widget.
Thanx for help in advance

Toggling for Live Webpages

I am currently working on a project at my internship where we are trying to create some kind of display that shows live status updates of our servers. I have the webpages I need to use on file; however, I am very confused on how to code the display. We are planning to use HTML and JavaScript, so I have been able to find these links. Are they leading me down the right path?
Javascript to rotate between pages within ONE HTML page
https://www.wikihow.com/Toggle-HTML-Display-With-JavaScript
Still, I am not sure how to add the links in there as well as if/how to write the CSS.
Any help would be appreciated!

Remove unused CSS links and JavaScript scripts

I'm developing a website and I want to remove unused stylesheet links and JavaScript scripts from my HTML pages to make the page load faster.
I'm using PhpStorm and it would be really grateful if someone could help me with this.
For css you can use: https://unused-css.com/
For js you can use: https://marketplace.visualstudio.com/items?itemName=RobertHoffmann.FindUnusedFiles
unused-css is using a headless browser to generate its report. If your site is using JavaScript to generate content based on user actions, it will not work correctly.
Tools like https://www.bleachcss.com/ or https://github.com/purifycss/purifycss are much better to handle this case.

Custom user HTML input safety

I am creating a website in php. One of the features is that users can edit their own pages by entering custom html code. Right now, you can enter code into a textarea and have it displayed in a div. In the future I plan on adding more helpful tools to the user.
My question is how to protect my site from malicious code. I know Facebook has an option to put custom HTML in a page tab so it can be done safely. Currently, the html is being displayed by a php script that echos it onto a page so users can enter javascript in <script> tags as well. I don't know the full limits of javascript and html but I know that custom javascript embedded into the website has the potential to screw things up.
Here are my ideas so far:
Remove all javascript from user code
Pros: Easy
Cons: Users can't do anything interesting with javascript
Limit the javascript to only execute inside the display div
Pros: Safe custom javascript
Cons: May be impossible/very difficult
If anyone has ideas about how to do this or how Facebook did this, I would love to know! Thanks in advance.
If you are using php, an excellent solution is to use HTMLPurifier. It has many options to filter out bad stuff, and as a side effect, guarantees well formed html output.

Categories