How can I find out the position of an item contained by an array?
I know the name of the item and would like to know its position in the array, how would I do that? ...
I know the name of the item and would like to know its position in the array, how would I do that? ...
Like I have an array Array('one', 'three', 'two');, and, say, I want to delete the item three, how would I do it? ...
I'm working on a little image gallery, where you'd roll over a small thumbnail, the larger image would display over it. Clicking on the image would load a full size version in an overlay. http://shopcoobie.server303.com/shop/ The issue is with the larger image, the rollovers are working fine, but the script I have updates the href whic...
I was iterating over properties of document when I ran into an interesting phenomena in Firefox, document claims to support the property domConfig although MDC says it isn't implemented but when I try to retrieve the property I get an exception: Error: uncaught exception: [Exception... "Component returned failure code: 0x80004001 (NS...
With Google Map v2, I would like to be able to trigger a function when clicking a text in the InfoWindow of a GMarker. $(".foo").click(myFunction); ... marker.openInfoWindowHtml("<span class=\"foo\">myText</span>"); does not work. Why the event isn't caught inside the InfoWindow ? ...
After upgrading to jquery 1.4.1 i noticed there was an error anytime i tried calling json.parse. The issue is part of the regex used in json. it uses a $ in the pattern that conflicts with JQuery's $ shortcut. I don't want to use the non-conflict option with jquery because i have tons of places i'd have to replace the $ with the new cor...
I'm using hoverIntent which, as part of its settings, will call a function. I think this is called 'referencing a function' (correct?): var HIconfig = { interval: 250, sensitivity: 8, over: myFunction, timeout: 100, out: myOtherFunction }; However, I'd like to reuse said function at times and explicitly pass i...
OK, I'm stuck and I don't know what's wrong even after following Google's docs and reading suggestions here on Stackoverflow. Why can't I control Youtube embeds in my web page? If I create an HTML file with the <body> being: <object id="o1" width="480" height="295"> <param name="movie" value="http://www.youtube.com/v/qCTLCNmnlK...
I'm trying to set up a menu that can be navigated via the arrow keys. I have this working fin in Firefox. Trying to get it to work in IE8 and after a bit of struggle, found that it was because IE8 wouldn't register a keypress on the arrows. To test: $(document).keypress(function (eh){ alert(eh.keyCode); }; In Firefox, pressing a...
Hello, I want to add helpful text (in javascript WITHOUT ANY FRAMEWORK USE) in input fields text and textarea something like this but dont know what its called As it is used in me.com but I dont want to submit the values that are used as helpers. Sorry for bad english. Thank You. ...
Hi, I'm a little confused about the best practice to achieve the following: I have an object which requires the load of 2 JS libraries(jQuery and swfobject), who may be already loaded or not, so i have to check both before calling the final method (output). Another tricky thing is that i have to pass some arguments to the initial metho...
Hi all, hopefully a simple question here. I'm running a Wordpress blog that has a bunch of links to different cities, which point to a location on a Google map. My current setup involves having an iframe for each link, and that iframe pops up in a thickbox when it is clicked. Now that my list of cities has grown, I have many, many ifr...
All, On some mouse over, div1 is displayed.How to display the div next to the mouse pointer so that even mouseover at the end of the context the div should show up next to the mouse pointer. <style type="text/css"> #div1 { width: 200px; height: 30px; background-color: #a9a9a9; color: #fff; position: absolute; } </style> <script src="jq...
Google hosts a number of JavaScript libraries such as jQuery and dojo on their CDN. For some reason, their own Google Closure library does not seem to be included. Is there a hosted version of the Closure library? ...
I have an instance of a logging class "logger", this class has a function "log(txt)", which works. Now I am declaring a different class "Runner" and I pass it the logger instance in the constructor. Everything works until line 5, but line 7 does not write to the log: var Runner = function (logger) { // constructor: logger.log("this...
Hi, I try to define a live event on img tags store on a iFrame. For example, I would like obtain a simple javascript alert box when I click a image on my iFrame. Do you know how i can define the events for the iFrame, because I would like to put a thing like $('img').live("click",function().... but only for the elements on iFrame. Tha...
I am looking for a way to 'fix' a dollar symbol $ to a text input box eg <input type="text" value="$" /> but make it not possible for the default value to be removed, so that whatever the user inputs, there is always a $ symbol 'prepending' input. Cheers ...
I have this code in an HTML page: alert(JSON.stringify(new Date())); I'm including the latest json2.js (2009-09-29 version) in my page to support older browsers without JSON.stringify(). I also have jquery-1.3.2.js included. I believe in newer browsers with native JSON support, it just passes through to the native JSON feature. Her...
I've noticed all over the place people mention "Just define a variable in the top of your JS code and it becomes global" in response to questions like, "How do I create a global variable from inside a function?". Most of the answers start by saying it isn't possible to achieve that. Of course it is possible to do this: <script type="tex...
I tried the following in JavaScript (Firefox 3.5, Windows XP): (function(){ window.foobar = 'Welcome!'; })(); var foobar = 'PWN3D!'; alert(foobar); The output was 'PWN3D!'. Why did my code PWN me? I thought var name = value; executed first. ...