javascript

How do I insert an entry into browsing history via JavaScript

How do I insert an entry into browsing history so back button goes to different page 1st click then original page on 2nd click? So if you need a good explanation of what I want done, go to: https://secure.exitjunction.com/howitworks.jsp I just need a script that will allow me to insert an entry in the browsing history so when back butt...

Loading progress in php, ajax or javascript?

Any one know how can I display the loading progress with completed % on my client side while the system is still getting data in the server side. For example, when I press 'ok' button in the client side, it will call to server side to collect data from the database, the whole process may take 2 to 3 mins. How can I display the loading p...

Storing references to DOM elements

In a particular script I'm writing, I have a number of objects which are linked to some DOM Elements. Given that each element has a unique id, should each object keep just the element's id (and use document.getElementById each time), or store the element in a property? Here's a simplified example of what I mean: function myThing(elId) ...

Disabling LinkButton doesn't disable the click event in javascript

I want to disable a LinkButton clink on the client site. objLinkButton.disabled = true; // or objLinkButton.disabled = -1; This disables the link but I am still able to click on the link and do PostBack. Is there any way I can disable the link. Code: <asp:linkbutton id="xyz" runat="server" onClick="javascript:LinkD...

Can jQuery get all CSS styles associated with an element?

Is there a way in jQuery to get all CSS from an existing element and apply it to another without listing them all? I know it would work if they were a style attribute with attr(), but all of my styles are in an external style sheet. Thank you Stackers ...

Why is my setTimeout() call not working?

Anyone know what's going wrong with below code? The system will only call the getProgressMsg() after the Ajax is completed :( function ajax_action(action) { setTimeout('getProgressMsg()',2000); xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } v...

Should I learn C before learning Javascript?

Would it be better to learn C before learning any type of WEB and desktop programming? I don't know how to program, I want to learn Javascript and my friends suggested to me that I should learn C first. ...

JavaScript to encrypt-decrypt html files

Dear all, I have a folder containing thousand of html files. I want initially all these html files should be in encryted form and when a call to paticuler html is made, it should be decryted and should open in browser and after that when next html will be called the previously decrypted html should be deleted or again encrypted. Can ww ...

sql - updating without overriding existing information

I have the following conditional code, which will insert a new record if a record with the appropriate username does not exist, and update the record if it does exist. This works fine. However, at the moment, if I insert a new record, and only insert the firstname and lastname, and maybe address details with say phone information being ...

Using jQuery, how do I get the text value of an element?

Hi, how do I retrieve the text between the href tag? <a href="blah">GET THIS TEXT</a> It is wrapped in this DOM: <div class="c1"> <div class="c2"><a href="#">GET THIS TEXT</a> </div> </div> ...

fetching html that is actually a number, want to add 1 to it and replace it

Hi, i'm trying to add 1 to a value that I fetched from my HTML using jquery. At the moment it is appending 1, treating the value as a string. ...

any references for differences between how FF and IE treat javascript?

Is there a list of differences between how FF and IE treat javascript? for example, I remember array references was a little different between the two. ...

Read session value with Javascript

Is it possible to read a session value with Javascript? For example, if I assigned a value into a session in PHP: $_SESSION['msg'] = "ABC Message"; Is it possible to read $_SESSION['msg'] with Javascript? ...

How to disable a link in IE6.

I want to disable links in a page. I used the function below, which is working in FF3 & IE7, but it is not working on IE6. $(document).ready(function() { $("a").attr("href", "") .unbind("click") .click(function() { return false }); }); ...

Are zero length timers still necessary in jQuery?

I am finally getting around to really implementing some jQuery solutions for my apps (which is seeming to also involve a crash course in javascript). In studying examples of plugins, I ran across this code. I'm assuming the author created the zero length timer to create some seperation of the running code, so that the init functon would...

Javascript does not work in IE8

The following JavaScript works on IE7 but not on IE8: onclick=history.back(1) or history.go(-1) Any suggestions on why this is the case and how to overcome it. ...

How can I setcookies in php server side with ajax and read cookies in the real time with ajax or javascript?

How can I setcookies in php server side with ajax and read cookies in the real time with javascript? Example: After pressed "ok" button, the client side will call ajax and ajax will call to php server side to collect data. It will also assign value into cookies in php server side while it's getting the data. At the sametime, I want to...

How to buffering an Ajax Request?

Hi guys, I have a simple ajax function, something like this: var x; var myRequest = new Array(); function CreateXmlHttpReq(handler) { var xmlhttp = null; try { xmlhttp = new XMLHttpRequest(); }catch(e){ try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }catch(e){ xml...

Javascript variable passing

Can anyone help me with my project? How will I be able to call the textfield details in javascript? function AddPushpin() { var shape = new VEShape(VEShapeType.Pushpin, map.GetCenter()); shape.SetTitle(**//it should be coming from a textfield//**); shape.SetDescription('This is shape number '+pinid); pinid++; map.Add...

Java script Validation for Email Id

Duplicate of lots of other questions: http://stackoverflow.com/search?q=validate+email Hi, I want to validate emailid by java script. I am using following code. var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/ ; var emailid=document.getElementById("<%=txtEmail.ClientID %>").value; var...