javascript

How to collapse JavaScript function/comment blocks in VS2010/VS2008

I don't think it is possible right now in VS2010/VS2008 but I'm sure someone must have done or can come up with some workaround using the extensibility of VS2010/VS2008. Ability to collapse javascript function/comment blocks within script tag in an aspx file editor and in javascript(*.js) file editor the same way we can do in any other ...

javascript: call an embedded function from a GM script

On a webpage there's <script> function fn982734() { // some code } </script> In my Greasemonkey script, I have the following code: var fn = fields[5].getElementsByTagName("a")[0].getAttribute('onclick').substr(7,11); console.log(fn); // outputs fn982734 to the firebug console window[fn](); This code does not work, and s...

Why should anyone use the new google wysiwyg editor?

Yesterday google introduced their wysiwyg editor and I was really exited. However it seems to be kind of heavy. Online demo It took my Firefox 8 seconds to download all 180 requests. The network traffic was 2MB. What is the point of using it anyway? ...

What IDE to use for standalone Javascript debugging?

Hello. I have a few projects that are scripted via javascript. Not a web pages, unfortunately - just a javascript code that calls a few external methods like api.Log( "This is log" );. Is it some IDE exists that i can use to debug such javascript code? I just want to run some unit tests on math and logic so i can break into program, wal...

javascript-getelement

what type of values given to getElementById() method ...

How do I create the a web form which is always visible in the bottom of the page?

Please have a look at the following page: http://www.eddale.co/general/on-reception-the-iphone-4-hysteria-the-real-lifelab-test-conundrum I want to create a similar form like the one always sticking to the bottom of the page in the link above ... how do i do this? ...

How to position an element below a text box carret in javascript?

I have a long text field and what I want to do is that when a user types an '@' character a list of users appear just like a typical auto-complete. However I want the list of users to appear below the '@' character which could be 20-30 characters in from the start of the text box. I've found many jQuery auto-complete plugins but none t...

Server calls happening twice

I am using ruby on rails at back & javascript on front end to communicate. I am using $.post() / $.getJSON & both of these calls are happening twice ! I am seeing logs of two different calls in server & if I print something in callback function , its printed twice as well. I am pretty sure its nothing due to my code as even simplistic r...

how to find no of div inside a form? and assign the no to a variable for next and previous buttons?

<script language="javascript" type="text/javascript"> var value1=0; var total_no_div; var previous; function doSwap(val) { divs=document.getElementById(form).getElementsByTagName(val); document.write(divs); } </script> </head> <body onload="doSwap(0)"> <form> <input type="button" id="button" value="previous" name="previou...

what does (gs.left != (t = left + "px") && (gs.left = t);) do?

IE appears to be choking on the following line 2207 from the uncompressed raphaeljs 1.4.7 (in the context of my code, of course): gs.left != (t = left + "px") && (gs.left = t); I'm unfamiliar with the != syntax in this context so I'm finding difficult to figure out what is going on or why IE might be unhappy about it. I've tested in I...

dijit.form.Form inside dijit.Dialog not working as expected in IE7/8 - works fine in firefox/chrome

Inside dijit.Dialog, I am trying to process a dijit.form.Form. The problem is: on hitting the submit button, the dialog box just closes and does nothing - while it's expected to submit the form to login_submit.php and alert() with a message saying the form was submitted successfully. This works fine on Firefox/Chrome though. The code is...

Looking for an event based flash based video player (java script)

I need a flash based video player that is able to trigger events I can listen to via JavaScript. The events I need to listen to are: The play button is pressed The pause button is pressed The video stops (is finished) ...

Change value of hidden form field to range of entered number

Hi, i have a simple text input field users put in a number. I need to check which range the number matches (e.g. >10 or <1 ) and save a separate key/value for that range in the database. I thought about a hidden field that changes its value as the user enters data but i don't know how to determine the range. (I cannot modify the submit...

Jquery Popup with PHP

I am using a j query pop up for my web application.I need multiple pop up in same page for different purpose.I am using different id to invoke these. The problem is about Click out event!(out of popup). I am using the script as follows to close the layer //Click out event! $("#backgroundPopup").click(function(){ disablePopup("#...

How to stucture JavaScript Code in Large Applications

I work on an application which now has a rather large JavaScript code base. It's got code we have written and files for the various libraries (jQuery) and plug-in being used. This has grown to be an awful mess. Repeated methods, no clear structure and so on. Are there any good guidelines on using JavaScript within large applications? ...

Trouble with Cookie persistence in IE

Hi all, I am setting my cookie when user click a certain link on my web page. I am using jQuery Cookie plugin developed by Klaus Hartl. To set the cookie value I do the following: $.cookie("lanVal", "tv", {expires: 3}); But when testing the cookie functionality, I see that IE does not save the cookie properly. All other browsers ret...

My Javascript (and Mootools) function is not returning true or false

Hi Guys/Gals I have the following function: function validateField(query) { new Request.JSON({ onRequest : function() { }, onSuccess : function(json){ return true; }, data : query + '&validate=true', url : base + 'ninjquiry.php' }).send(); } N...

Javascript Internet Explorer regex problem

Hi, i have this js code : var str = "javascript:__doPostBack('ctl00$M$List$_rli2$ctl06','')"; alert (str); var str = str.replace(/\$_rli\d+/, "$_rli" + 7); alert (str); And in IE it produces me result as follows: javascript:__doPostBack('ctl00$M$Listjavascript:__doPostBack('ctl00$M$List$_rli2$ctl06','')rli7$ctl06','') while it s...

Javascript/JQuery GetDay()

Hi guys, I have the following code: http://jsfiddle.net/SPWWx/ I'm completely new to javascript, this is my first time using it. The values of the HTML selects MUST be 01,02 etc, that's why I had to use a big long if else statement. The values have to be submitted to an application on a server, which is extremely fussy about what way i...

Back and forward buttons in an iframe.

How to "implement" back and forward buttons in an iframe with JS? ...