/ Sign-up
Your question

How to block a certain Javascript?

  • Programming
  • Javascript
  • Apps
Last response: in Apps General Discussion
June 25, 2012 8:08:48 AM

So I'm using a website builder application provided by my web host. I wanted to add a slideshow of images with JS and now it won't let me edit the front page anymore. The website builder uses Javascript as well so blocking JS from Chrome's settings won't help. Is there any way to block a certain script on the site? I'm using this script:

More about : block javascript

a b L Programming
June 25, 2012 12:41:44 PM

In Firefox's Firebug add on you can modify the current page HTML and styling. I think you can do the same with Chrome's in build developer tools accessed from, unsurprisingly, the tools menu.

If you know the code you don't want to run just alter that onclick or whatever. Note thought that if you refresh the page or navigate away you'll lose your modifications.

Other than that I think you might have a hard time disabling just one part of the Javascript. Most developers will have code in line or encapsulate Javascript code in an entire file or a series of files over having something as mental as a file per Javascript function.

Have you considered that your JS might be breaking the front page which is why you can't do the edit you need? Check the console for Javascript errors.
June 25, 2012 12:55:07 PM

Uncaught ReferenceError: jQuery is not defined
Failed to load resource: the server responded with a status of 404 (Not Found)

That's what Chromes console says. I tried with Firebug also but didn't help
Related resources
Can't find your answer ? Ask !
a b L Programming
June 26, 2012 12:43:46 PM

So something on your page is breaking the loading of the JQuery javascript library (presumably what the website builder application is using). The dynamic slideshow you are using isn't using JQuery; it's native Javascript.

If you're paying for your web hosting then you are probably entitled to some support from them. I'd ask them to investigate your issue - you may even be helping other users using their web hosting with a similar issue.
June 26, 2012 5:22:42 PM

Yeah I asked them and they removed the JS from the source code and it's now fixed. Don't really know what was causing this but it's fixed now :)