This is slightly off topic, but if anybody can solve this, it'll be this mailing list. The basic question is: Is there a way to catch an error thrown in an external js library so that I can continue parsing the remaining javascript on the page? The more detailed version is this: I'm using DotNetNuke (DNN) for my website. A module that I'm using include Scriptaculous, DotNetNuke uses a mixture of jQuery and MS AJAX. To avoid namespace pollution, the DNN folk have used the jQuery prefix for jQuery functions and the $ shortcut for MS AJAX (actually, I think this is the only way you can do this). The third party module uses $ to reference Scriptaculous. I think we all know where this is going: the namespace pollution of $ causes an error to be thrown very early on, leaving parts of my page unstyled (cornerz), dates unformatted, etc, etc, etc. The good news - for me - is this only happens when an admin is logged in. My thought would be to catch the errors and continue parsing <i>my </i>portion of the page.
I'm trying to load some javascript files via ajax, I can't get it to catch 404 errors. I've tried searching, but everything I've found says that I should check the status on the request object to catch it but it's not even getting that far.
I've tried:
I would try $.getScript, but that appears to have no way of handling errors. I've even tried just doing a console.info("test") -- it doesn't even do that. Firebug shows a 404 error (obviously) but the error doesn't seem to be being caught? I'm loading jquery through the google api, version 1.3.2.
Ok, my jq slider is clashing with light box. Found the answer here: [URL]...but don't know where to insert my code within my head below for it to work ?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!--Twitter Feed--> <script type="text/javascript" src="http://twitterjs.googlecode.com/svn/trunk/src/twitter.min.js"></script>
I have been trying in vain for many days to resolve a conflict between javascript libraries. My homepage uses jquery horizontal css menubar + a combined mootool and prototype accordian type sliding information box in the middle of the webpage. I find that the highlighter of the css menubar does not work when prototype.js is also loaded on the same page. I have read somewhere that $ should be replaced however I have tried every possible option and none works. I have jquery loading first as it is on my template, with this: <script type='text/javascript' src='../Web/Templates/jquery-1.3.2.js'></script> <script type='text/javascript' src='js/example.js'></script>
And my mootool and prototype loades further below like this: <script type="text/javascript" src="scripts/intro/prototype.lite.js"></script> <script type="text/javascript" src="scripts/intro/moo.fx.js"></script> <script type="text/javascript" src="scripts/intro/moo.fx.pack.js"></script> <script type="text/javascript"> function init(){ var stretchers = document.getElementsByClassName('box'); var toggles = document.getElementsByClassName('tab'); var myAccordion = new fx.Accordion( toggles, stretchers, {opacity: false, height: true, duration: 600} ); //hash functions var found = false; toggles.each(function(h3, i){ var div = Element.find(h3, 'nextSibling'); if (window.location.href.indexOf(h3.title) > 0) { myAccordion.showThisHideOpen(div); found = true; } }); if (!found) myAccordion.showThisHideOpen(stretchers[0]); } </script>
I want to do something with JavaScript on my website but don't know how to implement it, but i've found it has already been written by someone and is available to download free as they've put it on net. So is it right morally to use something that someone has already been written? does this count as cheating? does it infringe any copyright?
I'm interested in finding some JSON libraries for javascript that contain a stringifier and/or parser. I've been using what appears to be the reference implementation from json.org (written by Douglas Crockford?), but I'm running into two problems:
(1) The lack of support for the hasOwnProperty method in Safari
(2) Odd, intermittent errors in Gecko browsers, something to the effect of "llegal operation on WrappedNative prototype object."
If anyone's familiar with other libraries, or with ideas for working with these issues in using the json.org library, I'd love to hear about them.
There is this technology used in this great website that doesn't stop amusing me, I was just hoping someone could cypher the technology behind it and perhaps reveal it is done with the help of some freely available Library the link to this DSL Internet provider company is:
[URL]
just insert this postal zip code in there to test the service: 68161that is a German Zip coad for the city Mannheim.
I need to use a couple of third-party Javascript libraries which have multiple JS files. Since @require doesn't work on Chrome, how can I add multiple external JS libraries to a userscript? I'm considering all the possibilities before choosing one.I know you can add jQuery using this method. I have personally used that. But all my other code would have to run inside the main function of this code! I think that would be a problem when there are many libraries to work with.
I was wondering if there are any proper, robust libraries or functions/methods that I don't know of that will escape all the problematic characters such as single quotes and tabs.
I find myselfwriting x = x.replace(/'/g,"'"); and the reverse over and over again. Shouldn't Javascript have a built in method to do this? I know of the escape() function but I am not sure if this is more for urls. What is the real world way of storing such an "escaped" variable in a database that will later be read into a javascript variable? :-/
Maybe one could use escape() and unescape() in some way, but some expert probably could answer this in a snap.
The topic of event handler management has been covered in many places in the past. One location is in the contest by PPK (http:[url]....). The winning submission by John Resig (http:[url]...._and_the_winner_1.html) has a few problems, and the commentary on the site seems to gravitate to the implementation by Dean Edwards (http://dean.edwards.name/weblog/2005/10/add-event2/) after the analysis of the Resig code.I was also able to find a few more implementations on stackoverflow from: Bill Ayakatubby (http:[url]....) and Marco Demaio [url].....
Outside of the JavaScript frameworks, what is generally done for supporting event functionality? There are numerous options each with their own benefits and drawbacks. I'm uncertain of which one to use myself. Is there an undeclared de facto?
I've decided to use the drag and drop option for my gadgets in my home page. The size of the gadgets may vary and user may choose the gadgets and choose the place too. Is there any api or libraries which I can easily configure the drag and drop option in js and php.
I wirte a simple sample to alert 'here' when catch submit event. The code as below. When I press submit button , it works fine. But when I press b3 button , it will call a function to submit the form. The form submit is ok , but it will not alert 'here'.
the image is like <img style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (src='aa.png')" ... > $('img').css('filter') will get progid:DXImageTransform.Microsoft.AlphaImageLoader(src='aa.png') Can I get the aa.png directly?
Are there any good web UI component libraries -open source or commercial - that you can recomment? They need to be cross browser compatible and have good documentation. Jquery UI is very good but limited in number of controls it offers. YUI is very verbose and very hard to use. extJs only other one I can think of. Any others you use and like?
I'm using the jquery cycle plugin. the entire page is a slide show. Its working pretty well so far but now i want the body background to change as the slide changes.Is there someway to us .live() to catch the event, and then dynamically change the body background?
I've got a problem with a jQuery slider I'm using on a website I'm currently developing (temporarily hosted at [URL]. Generally it looks and functions as I'd like it to, but it seems to have a problem when you're looking at other tabs/websites in your web browser. When you come back to the slider having been looking at something else for a minute or so, the slider effectively plays catch up and quickly scrolls through the slides faster than usual until it catches up with the position it would have been in had you not have been looking at another tab and left it to run. This seems to happen in all web browsers as far as I can tell.
The page im loading with $.get has a syntax error that is killing my entire script. Is there anyway to test if it contains a syntax error and/or just ignore it?
$.get('http://www.example.com/',function(response){ var someText = $(response).find('#myDiv').text(); // Script doesnt run after this because response contains a syntax
The problem: The addClass does not affect the styling of #title. Firebug shows .error, but as an empty selector. And, BTW, is this an appropriate way to flag errors -- by adding or removing a class?