javascript

Removing javascript created content...

Hi Everyone, I have some java script that work behind a navigation menu, the user clicks the nav button, and some AJAX fires and brings in some HTML, what I want is for if that same link is clicked again then the content that was loaded in by that specific button is removed from the markup. Does anyone have ideas? My code currently stan...

Accessing XML file using JavaScript And ASP.net |VB code

Am trying to read in data from an xml file but using javascript which is embedded into my asp.net|vb code. I am new to asp.net but coming from a programming background. so I declared the xml objects for the appropriate browsers, as well as the name of the local xml to read data from, I then start by appending the create the table tag a...

exist a javascript callback cache??

Look this code guys: <script type="text/javascript"> $("#<?=$delete_uid?>").click(function() { var id = $("#<?=$grid_uid?>").jqGrid('getGridParam','selrow'); alert(id); if(id == null) { $.jGrowl("No selected Item"); return; } confirm('Caution','Delete current selected item?', function(result) { ...

document.createElement('script')... adding two scripts with one callback

I need to add prototype and then add scriptaculous and get a callback when they are both done loading. I am currently loading prototype like so: var script = document.createElement("script"); script.src = "http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js"; script.onload = script.onreadystatechange = callback; document...

How can I add an onclick to a generic control in asp.net?

I want the programmer to pass a Control to a method, and then I want to add an onclick to it. But control doesn't have an Attributes property. Is there an interface or something deriving from Control that I can use, to add an onclick attribute to it? Note that I want to add a javascript onclick (clientclick?). ...

Trouble intercepting AJAX (XHR) requests from GreaseMonkey script

My userscript's task is fairly simple -to listen to XHR requests via an XHR bridge sort of functionality, manipulate the data received, and return it back. Everything happening transparently, of course. I came across this reply (http://stackoverflow.com/questions/629671/how-can-i-intercept-xmlhttprequests-from-a-greasemonkey-script/6297...

How to refresh the form value using JQuery

I have a html form. I want to take the input value (a url), extract a number from the url using regex ( '/[0-9]{5,}/') , and then refresh the form value with the number extracted and appended to another url. If I can't find a number - I just want an error to appear in the form box. All using Jquery to avoid page reload. This is the ex...

Drag & Drop Javascript sortable with moving marker?

I am searching through "drag & drop sortable" Javascript libraries such as Prototype's sortable, JQuery's sortable, and a number of standalone ones. I feature that I can't find (but know it's out there) is, I can't think of a better word, "delayed" sorting so that when I move an item around on the list, it will not be moved immediately,...

Calling Functions in Objects with Javascript

I have an object defined like this: Blah = { hideTimer:null, setTimer: function() { this.hideTimer = window.setTimeout(Blah.hidePopupInner, 500); // must be done via window due to Greasemonkey }, hidePopupInner: function() { log("This? " + this); }, hidePopupInnerPublic: function() { Blah.hidePopup...

Get a controls full ClientID from just ID in asp.net (client side)

This problem is the bane of my asp.net coding life. I have a control, in code, and I want to get its full ClientID but I cannot until I add it to the page. However I cannot add it to the page yet. I want to add some javascript to the onclick. I can add something like "myMethod(this)" to the onclick, which is great and sidesteps the p...

javascript - loop multidimesntional array

I am sure this is really simple, I used to have a function for checking the contents of an array. Now Id like to modify it to check a two dimensional array. function ChkArray(Str, Val){ for (var i=0;i<Str.length;i++){ if (Str[i] == Val) {return i;} } return -1; } My new attempt: function ChkArray2(Str, Val){ for (var i=...

Javascript creating <div> on the fly

Hello, I have a a link that looks similar to this <a href="/home/category/blog/1" id="blog">Blog</a> As you can the link has an ID of 'blog' what I want to do is to create an div on the fly with the ID from the link that was clicked so if the 'blog' is clicked, then the markup would be <div id="blog"> <!--some content here--> </div...

Limit Ajax mouseover

I would like to know what's the best way to limit ajax call / time. I'm running the following js function when the user mouseover a table row. function load() { $.ajax({ type: "GET", url: "process/ajax.php", data: "action=action, success: function(msg) { if(msg!='') ...

Returned AJAX array not being copied to array

I have simple AJAX function that uses jQuery to return an array of 300 test objects from a database. I can see the data is returned, and I can use FireBug to step through the first loop and step into the constructor. This data is copied to an JS array. The code fragment looks like: //retrieve star locations to display on page $...

Javascript compressor problem

Hi to everyone, I have a problem I would like to compress all my javascript, but inside of my javascript code I use php stuff... like php if, php variables. How can I manage that? Thank you so much ...

javascript proplems

lets say i have a list of links: <a id="home" href="#"> home link </a><br/> <a id="list1" href="#"> some text1 </a><br/> <a id="list2" href="#"> some text2 </a><br/> <a id="list3"> href="#"> some text3 </a><br/> <a id="list4" href="#"> some text4 </a><br/ <a id="list5" href="#"> some text5 </a><br/> <a id="list sails" href="#"> sails...

Can we write javascript to run in the webmail? If so how do we handle such situation.

Could any one of you explain me for the below situation. When I open a new mail the content of the mail(mini application with four or five modules) should be displayed in javascipt? How do u do that? Please revert me to [email protected] ...

Javascript message to confirm when exiting a form

I have some javascript code to alert the user that leaving the page will lose the answers to form questions. window.onbeforeunload = askConfirm; function askConfirm(){ return "Your answers will be lost."; } I'd like to make this happen for everything BUT a form submission. My submit button has the ID #submit and I am ...

Problems with IE7 keeping two buttons in a same line

Hi all, I have a problem with IE7. I'm trying to put 2 buttons in the same line.. but its not working only for IE7 in all other browsers it works as it should( didn't check IE6, will no check). Here is a picture so you know what I mean This black border you see is just something I put so I can see how long/tall is my div. Which css s...

Is it possible to override radio buttons style with css?

I need to make special radio buttons, is it possible to make my own images to cover default style of radio buttons? If it is not possible what is best way to do this with jQuery or is there good plugin for this? ...