javascript

how do I add a parameter to an ajax call using jquery?

I want to be able to call a URL be either a standard HTTP GET, or an AJAX call. The server needs to handle the request slightly differently based on whether the request was an AJAX request or not. Using jQuery, I want to automatically add a parameter to all AJAX requests I make, so that the server can identify them, and without me havi...

Valid Characters for JavaScript Variable Names

Hello to all, Just wondering if anyone can point me to a webpage detailing the valid characters that can be used for naming a JavaScript variable. I want to create a small 'extension library' for my non-javascript users here at work (who all seem to be squeamish when it comes to the language). I love how jQuery and Prototype have bo...

Stop IE from loading dynamically included script twice

I am including some related content on misc. web pages by adding a <script> tag near the end of the <body> tag, which then loads other javascript files. The flow is a little convoluted, so I’ll try to explain it before asking my question: A browser loads a page with our <script> element near the end of the <body> element The src attrib...

Nested Set model in PHP/Javascript to work with MySQL

I am using a MySQL Nested Set approach to store the classification of the various products that are sold on the website. I am looking for a nice javascript library to help out with rendering the tree from the nested set approach. I also need a good javascript drag and drop script to re-arrange and update the MySQL table. Are there any g...

How to include a js function from an external file inside a js.file?

Hello, In file1.js inside a function I need to call a function which is actually included in file2.js How can I do it? Thank you Later edit: This is what I want: function back(){ if (step!=0){ dijit.byId('stackContainer').back(); }else{ //here I should call the save() function from file2.js } } ...

How can I find the first textbox in a container using Javascript?

I want to use javascript to find the first textbox in a container, so I can set it to focused, but the textbox could be nested. Is there an easy way I can cycle through until I come across the first textbox? ...

jQuery - char counter doesn't work with paste event

I wrote a jQuery character counter, it works when I type, but not when text is pasted. The function is executed upon paste, but count doesn't change. I am not sure if val() function is correct or really in synch with DOM. Any ideas? counter = function() { $j("strong#status-field-char-counter").text($j("#Panel1messagesmessage").v...

Better way to collect data on javascript compatibility

Is there a better way to collect data on how many visitors don't have js enabled. My idea was to add a hidden value at page load with js. If it works then js was successful. But looks like there's no way to actually read it back to know if it was successful unless I do some kind of a page reload, but now it gets complicated (I have to de...

Targeting JS named opening window in Safari?

HI all. I have a static HTML page which is named via javascript as such: window.name = "windowname". This window opens a popup window, which contains links that target 'windowname'. This works as expected in IE/FF/Chrome and opens the links on the opener, howeve Safari opens all links in a new window and not the opener. Is anyone awar...

Modal popup using Javascript and Css

I am using AJAX modal popup in my project, but there is problem with it. Now I decided to acheive similar behaviour using javascript I am able to show popup using document.getElementById('dv').style.display = "block"; Now I just need, how can I make background disable like in modal popup? ...

How does JavaScript memory work in browsers?

When building advanced JS-interfaces and games I've found that I have to dig deeper in to how browsers handles memory for JS. My experience with memory and JavaScript is that the memory gets glogged (and makes animations and calculation slow/lagging ) when: There is alot of JS-generated content on the page There is alot of graphics (i...

Hidden Columns in jqGrid

Is there any way to hide a column in a jqGrid table, but have it show when the row is edited in the form editor modal dialog? ...

jQuery: find next table-row

I have a table, containing rows, contaning cells - and some of them contain an img as follows: <img id="FormView1_btnSave_row1%1%new" style="border-width: 0px; cursor: pointer;" src="grafik/ok_16x16.gif" onclick="cleverStuff(this)"/> In the function cleverStuff I would like to operate on the line that follows the line in which the but...

JavaScript CodeExplorer tool?

Where can I find an editor/IDE with the ability to display a JavaScript code explorer? There are many editors which display that for PHP files, some of them for JS as well, but so far I haven't found one which displays the class structure of the JS file. I tried parsing the "prototype" framework with PSPad, but unfortunately it doesn't d...

getting an element id from a plain javascript call

This example is simplified a bit, but in my ASP.NET web page in my c#/jquery code I am using a right hand context menu that displays ‘rightMenu’ when a right mouse is clicked. $(document).ready(function() { $(".RH_signoffrow td").contextMenu({ menu: 'rightMenu' }, function(action, el, pos) { var mykey =...

HR tag stays hidden while containing div is shown with jquery

I have a hidden div which I reveal with the jquery fadein() method: $("#panel").fadeIn("slow"); and here's the html: <div id="panel" style="display:none;"> <hr/> <p>text</p> <button onclick="cancel()">cancel</button> </div> The text and the button within the panel is shown properly when the method is called but the hr stays h...

External Reference of a Javascript file in IE

I am working on a website for a teacher, Since there is a chance she may want to add more later, I decided to make the links that appear on every page be written in by Javascript so that all the pages could be changed quickly. The HTML code has this for the external reference: <script type="text/javascript" language="javascript" src="l...

jqModal close, reopen issue

A Jquery Modal is called with two form elements. There is also an option to close the modal. One scenario is that the user would close the modal, and can come back to it. But when the user come back, the form elements do not work, and the modal just closes upon a click. $('#test').jqmAddClose('#test'); My assumption is that whe...

Close with Custom Chrome

I'm using Adobe Air with a custom chrome and want to have a close button to close the window I'm just starting out so I have no idea. I'm using HTML and javascript with Aptana Studio. ...

Ordering elements by number in JQuery

Hi, how could I arrange the following div's by the value in the attribute amount with jquery? Thanks. <a href="#" id="id1" class="lTest" amount="12"> <div>abcd1</div> <a/> <a href="#" id="id2" class="lTest" amount="64"> <div>abcd2</div> <a/> <a href="#" id="id3" class="lTest" amount="32"> <div>abcd3</div> <a/> <a href="#"...