javascript

fetch the data of an particular <td> in a table

hi friends, I need to get the data of an particular <td>, but I don't have any id or name for that particular <td>. How do you get the contents of that <td>? For example: <table> <tr><td>name</td><td>praveen</td></tr> <tr><td>designation</td><td>software engineer</td></tr> </table> Is it possible to get the value "designation" f...

Regex - is there something I've done wrong?

This is javascript, but a virtually identical regex is failing in PHP too, so I don't think it's language specific var r = new RegExp( "^(:19|20)?[0-9][0-9]" // optional 19/20 start followed by 2 numbers + "-" // a hyphen + "(:0?[1-9]|1[0-2])" // optional 0 followed by 1-9, ...

javascript post

hi, i have a javascript function, that i use to open a new window, post a form in this new window and check the results there. The code work fine in IE7, but don't work in FF3. Somebody knows why? I call this function in a button Onclick event: function OpenEdit(id){ var sData; var sDomain = "http://foobar.org/index.php?"; sData = "<for...

Best packing strategy for js during continuous integration?

I need to pack all my js, but need to edit it going into source control. is there a nice easy plugin for ccnet, or nant, that will allow me to pack my js, and store them in the same files on the way out to production. Not really looking for file combining, just minifying each file. ...

Ajax requests from xul not working in firefox 2

I'm working on a firefox extension and have been developing it in firefox 3, i went to test it on firefox 2 and for some reason none of my HTTP requests are firing. The format of the requests are below (using prototype): theResponse = function(response){ //some code } new Ajax.Request(url,{ method:'get', parameters : {url: currentURL},...

jqGrid with JSON data renders table as empty

I'm trying to create a jqgrid, but the table is empty. The table renders, but the data doesn't show. The data I'm getting back from the php call is: { "page":"1", "total":1, "records":"10", "rows":[ {"id":"2:1","cell":["1","image","Chief Scout","Highest Award test","0"]}, {"id":"2:2","cell":["2","image","Link Badge","When you are inve...

Is it possible to share ONE file with strings between ASPX, C# and JavaScript?

I'd like to externalize all of the strings used in the project into one file and be able to use it inside aspx, C# code behind and on the client side in JavaScript. The reason I want to do it is because many strings are shared, i.e. the same in two places. Is it possible? Is there a better way? ...

Unobtrusive javascript with jquery - good 10 minute tutorial?

I'm looking for a good 10 minute introduction to Unobtrusive Javascript using JQuery. I'm completely new to the concept, and I'd like to see how the event binding and such works. As some background, I'm looking to do a "remove this tag" system similar to what we have here on SO. Looking at the source, I didn't see any js, just an img ...

What is the simplest way to implement mouseover background color change for HTML elements?

I the following styles: a.button { background-color: orange; margin: .2cm; padding: .2cm; color: black; font-family: sans-serif; text-decoration: none; font-weight: bold; border: solid #000000; } a.buttonMouseover { background-color: darkGoldenRod; margin: .2cm; padding: .2cm; color: blac...

JavaScript function to match only Google URLs

Need a function like: function isGoogleURL(url) { ... } that returns true iff URL belongs to Google. No false positives; no false negatives. Luckily there's this as a reference: .google.com .google.ad .google.ae .google.com.af .google.com.ag .google.com.ai .google.am .google.it.ao .google.com.ar .google.as .google.at .google.com...

AJAX - Do I need to return a full HTML document on the server side?

I am using JQuery to post with AJAX to another ASP page. Do I need this ASP page to return a full html page. Or can I just have it send back a value ( I just need a status ) . Here is my function. $.ajax({ url: "X.asp", cache: false, type: "POST", data: queryString, success: function(html){ $('#x_'+Num).append(htm...

Javascript - multiple client-side validations on same event

I am performing two validations on the client side on the samve event. I have defined my validations as shown below btnSearch.Attributes["OnClick"] = "javascript:return prepareSave(); return prepareSearch();" Pseudo code for prepareSave(): { if (bPendingchanges) { return confirm('Need to save pending changes first, click ...

How can I use JavaScript to detect if I am on a cached page

I want to display from cache for a long time and I want a slightly different behavior on page render vs loading the page from cache. Is there an easy way I can determine this with JavaScript? ...

After clicking the nth item, how do I manipulate another nth element?

I'm using jQuery and wanting to target the nth <li> in a list after clicking the nth link. <ul id="targetedArea"> <li></li> <li></li> <li></li> <li></li> </ul> <div id="clickedItems"> <a></a> <a></a> <a></a> <a></a> </div> I can target them individually, but I know there must be a faster way by passing which <a> elemen...

AJAX on the iPhone?

I have a site that I've developed that makes decent use of Javascript, and minimal use of AJAX for a few things. The site worked fine on the iPhone until I added the function to create an HttpRequest handle at which point all Javascript on the iPhone now silently fails. So, I have a few questions. (1) It seems that AJAX does not work at...

Using jQuery, how do I disable the click effect on the current tab?

I have a menu with an animation going on, but I want to disable the click while the animation is happening. <div></div> <div></div> <div></div> $("div").click(function() { $(this).animate({height: "200px"}, 2000); return false; }); However, I want to disable all the buttons while the event is happening, AND disable the div that...

What is the "best" way to get and set a single cookie value using JavaScript

I want to increment a cookie value every time a page is referenced even if the page is loaded from cache. What is the "best" or most concise way to implement this? ...

Javascript shell?

I know that this question has already been asked HERE but sadly none of the answers suggest a javascript standalone shell that has auto completion. I am reopening this question again, in the hope that some new answers might be found. ...

Slide show using Javascript

Hi, I have a slide show using javascript where images display from another server (remote server). i have to display images from another server,problem is when i set "src" property of "Img" html tag, it append my server localhost path at starting as "http:\mysitehost.com\myremoresite.com\image1.jpg" where my image path is "http:\myremote...

Eclipse 3.4 Ganymede Javascript Validation Issue

I just upgraded to Eclipse 3.4 for the second time and I think its for good now. The first time (right when it was released) was too buggy for me to stomach (mainly the PDT 2.0 plug-in); but now it seems to be all worked out. My problem is the Javascript validator. If I define a class in one JS file in my project, then try to use it in ...