javascript

Replace an anchor with its innerHTML

Hi, I want to replace a link with its innerHTML, how is it done? Example: Bla bla bla <a href="#nogo">No link here</a> bla bla bla has to become Bla bla bla No link here bla bla bla Tried to replace the node with its innerHTML but I can't get the text in the node itself.. I guess I have to work with regular expressions but I can...

JavaScript to Submit Page After 30 Seconds

I am looking for a JavaScript to submit a page after 30 seconds from when the page is loaded. Does jQuery offer this functionality or does someone have regular javascript for this? Thank You ...

Debugging JavaScript in VS

Whenever I set a breakpoint in JavaScript in Visual Studio, the debugger never breaks at the point. When I put my mouse over the breakpoint at run-time, it says "This breakpoint will currently not be hit. No symbols have been loaded for this document." What does this mean? How do I enable JavaScript debugging/breakpoints? ...

Fading in background image with jQuery

How would you fade in a background image (the body tag, and it is tiled) with jQuery? The background color is white and in a callback function I want to toggle the background image to on and off. Any ideas? ...

Consuming Web Service from javascript in .net page

How to do it? I am completely new to this and wish to start learning it. I am going to have a tree structure, most probably a html/Javascript tree which will need to be saved into the database through Web Services. What is the most efficient way to do this with ASP .net web services + asp.net 3.5? UPDATED: thanks for all the answers, I...

Obfuscating your jquery code.

Possible Duplicate: How can I obfuscate JavaScript? Can someone please suggest a method to obfuscate the jquery code used in a website. Is it correct to do so from the functionality point of view, i mean will it work fine on all browsers after obfuscation ? Thanks. ...

how can I fix the jumpiness problem on a moving <LI> stream jQTouch mobile web app (iPhone JavaScript)

I've got a mobile Web app built with jQTouch mobile web app framework, but when I try to add dynamic <LI> elements the theme starts jumping around like crazy. Includes a short JavaScript sample program that replicates the issue. I posted this issue on the jqtouch Google Code ticket system Issue 134: slidedown prepends LI but causes th...

show div depending on select option

Oh help, I've tried it a million different ways yet it still does not work: If you select update or final from a select/option box, it should show the div that has an input field in it. It only does what the default shows in the switch statement. Of course, it's only after a selection is made that I want it to determine whether it shows ...

what's a good rule of thumb for max dropdown list options

Hi All, with the title being self-explanatory enough, if you do reach this max number, what do you do instead? thx :) -C ...

What is JQuery's equivalent of scriptaculous/prototype's auto-complete?

Prototype/scriptaculous can do an easy autosuggest in the input box. It's pretty much built in. How can I do that with JQuery? ...

I am new to JQuery and don't know how to do this specific task.

I am currently using this autocomplete plugin. It's pretty straightforward. It accepts a URL, and then uses that data to perform an auto-complete. This is my code to auto-complete it. autocompleteurl = '/misc/autocomplete/?q='+$("#q").val() $("#q").autocomplete(autocompleteurl, {multiple:true}); If someone types "apple", that autoco...

textarea autogrow functionality jitters with every keystroke

I was playing around with the jquery autogrow plugin, which expands the height of the text automatically as the text needs it. The problem is that with every key down, the bottom border of the textarea jitters in a noticeable way. I'm not sure what the problem could be, so I'm going to go out on a limb and post the 132 lines of this GPL ...

i need to build my url in a javascript function then return the string back to href

Hi, I need to call a Javascript function from an a element.. something like this: href='javascript:myjavascriptfunction();'. I need the Javascript function to get the values from a couple of datepicker controls, build and urlencode a querystring and return it so that it opens into a new window. So far I think I have everything, but I'm ...

jQuery compiled with Google Closure Compiler

Has anyone compiled jQuery against Google's newly-released Closure compiler? There has been reported huge savings in code size. I'm curious what the benefit is if jQuery was compiled with it. ...

How to use Google's Closure to compile JavaScript

Google just released Closure, which is a compiler to minify JavaScript. On the product site, it says "The Closure Compiler has also been integrated with Page Speed". How do I use Page Speed to compile my web pages JavaScript with Closure? (Or, is there a web site that I can simply paste in my JavaScript to have closure minify it? ...

Problem with LightBox Jquery

Can't seem to get my lightbox to work. Any ideas? <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" /> <title>WildFire</title> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/...

Script references in MasterPage or individual pages?

I there any benefit to putting the javascript references in individual pages vs the master page in terms of number of reloads and data transfer? ...

Conditional comment for 'Except IE8' ?

I'm using <!--[if IE 8]><![endif]--> for targeting IE8, but there's some JS that I want to load for all browsers EXCEPT IE8, what conditional comment should I use? Edit: I wonder if this would work: <!--[if lte IE 8]><![endif]--> Thanks ...

Get position relative to browser window

Hi, I have 2 divs and one is nested in the other. I want to get the child div position relative to browser window. The use case is this: when user scroll down browser, I want to detect the position of the child div and if it is 100px above the bottom of the browser window, I want to fade it out slowly. How do I do that with jQuery? The...

Get height/width of image in Javascript (ideally without loading the image at all)

Hi Sorry if this has already been answered, but I can't find it if so. I want to find the height and width of an image file in Javascript. I don't actually need to show the image in the page, just the height and width. At the moment I've got the following code, but it's returning height and width 0 (in Mozilla 5). var img = new Ima...