javascript

Open a new page on click of a link on new window

Hi, I have a page in which i have provided a link clicking on which should redirect to a new page on the new window. My code is <a href="javascript:void(0);" class="webMnu" onclick="window.open('http://abc.com','plain');"&gt;Enroll&lt;/a&gt; The problem is that it is working fine in firefox(opens in a new tab) but in internet explo...

How to implement a countdown clock on a product launch web page?

I'm asking this on behalf of a certain corporation: http://www.microsoft.com/visualstudio/en-us/watch-it-live Things to bear in mind: It's 8:30 AM at different times depending on where you are in the world. For example, where I am, it is already 10 AM, whereas in Redmond it's still only 2 AM. That's probably the main thing, I guess...

Javascript dom tree modification

Hi all, Whats the wayto modify the "body" of a dom tree like this using javascript: Original htm: <html> <head></head> <body> blah blah blah </body> </html> Modified html: <html> <head> </head> <abc> <body> blah blah blad </body> </abc> </html> That is, I wish to put the whole body node inside another node. The code I...

Get the largest value from Json object with Javascript

Hi This should be an easy one. I just cant figure it out. How do I get the largest value from this piece of JSON with javascript. {"data":{"one":21,"two":35,"three":24,"four":2,"five":18},"meta":{"title":"Happy with the service"}} The key and value I need is: "two":35 as it is the highest thanks ...

How to trigger saved password autofill in browsers?

I have a web application written in pure JavaScript (no pre-generated HTML except for the document which loads all the JS files). This app contains a login form which is created dynamically when the document.ready event event is triggered. I trick the browser into displaying the "Remember password?" dialog by posting the login form into...

jquery checkbox help getting checkbox name and value

The Problem I am trying to run some ajax on one my pages for my website, basically I have three checkboxes all of which on pageload are unselected, when a checkbox is clicked I need to be able load in via ajax the relevant HTML. This system is currently a PHP script that depending on what the POST is set returns a different view, so I t...

which is better to promote? IFRAMEs or External Javascripts

I want to provide a way for bloggers to use my link list in their blogs. which type of code should i provide? IFRAME or External Javascript ? the different aspects i think that are involved are SEO, Browser Compatibility, Cross Platform, Performance, and the code should be allowed in mose Blog Services. which one do u suggest? ...

has any method like substitute of mootools in jquery ..

this is mootools code: var myString = "{subject} is {property_1} and {property_2}."; var myObject = {subject: 'Jack Bauer', property_1: 'our lord', property_2: 'savior'}; myString.substitute(myObject); and does jquery has this mothod? or like this method ? ...

Javascript Cookie

How can i create a cookie by using javascript just for end of the browser session(ie,upto closing of current browser).My script is like follows; function setCookie(c_name,c_value,c_expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()+c_expiredays); document.cookie=c_name+ "=" +escape(c_value)+ ((c_expired...

How to read C# method output from javascript???

I have a C# class method that return a xml document not file. How to read C# method output from javascript??? I don't wont to use script manager. Any ideas? ...

how to use javascript to add link to image element created using javascript

how to add link for the image created using following javascript. thanks for any help or replies. for(var i=0; i<images.length; i++) { var t = document.createElement('IMG'); t.setAttribute('src',images[i]); t.setAttribute('border', 0); t.setAttribute('width',imageWidth); t.setAttribute('height',imageHeight); t.style....

Automatically reporting javascript errors to the developer

As most production environments we have setup something to send us a notification if there is an error in our web application. The problem is ofcourse that this only covers errors on the server side. My question to the community is: What are you doing about client side errors, especially in javascript? And what about other quality of s...

How to start a JS code when the whole page has loaded including images (real on complete)

I want to execute a script after the whole page has loaded, when it's complete. The current way is: window.onload=document.getElementById('loaded').value=1; Which is not good, as some images are still in load, and the page has not completed loading truly. What I am doing wrong? Certainly doesn't work for me in Chrome and Firefox. Th...

Can I use javascript regular expression in php as it is.

I am using a regular expression in javascript and want to do server side validation as well with the same regular expression. Do i need to modify it to make it compatible or will it run as it is. How to use PHP regular expresion. Please provide a small example. Thanks in Advance EDIT For Email Validation var pattern = new RegExp(/^(...

RegisterClientScriptBlock code not executing.

I'm using the following code in an attempt to show a dialog with a list of errors on the client: if (rollout.ImportErrors.Count > 0) { ClientScript.RegisterClientScriptBlock(GetType(), "showErrors", "showErrors();", true); } The error count is non-zero and the following script block is emitted, but the script isn't...

how to replace specific strings in HTML docs or specific elements ?

How can I parse a html document or just a html element in order to replace all specific strings into other ones ? In other terms: - search for all strings #### in element .class - replace them with $$$$$ I'm using jQuery.. thanks ...

How to prevent flickering on click of browser back button

Hi...I am working on Asp.Net application.I wrote the below JavaScript code to prevent the user to not going to login page on click of browser back button when he logs into the application.It is working fine for me,but from the homepage when i click on browser back button,the flickering appears due to post back.How to prevent the flicker...

Good Guide For Web App Security?

Hello! I am pretty good on making web applications and I know how to transfer data to and from client/server, etc. I need some help though learning how to make the data exchanges more secure. That is the reason why I feel kind of scared to publish any web app I make. I wanted to know what are some good guides to help you understand and l...

Detect Click on Browser

how do i detect which event I had clicked, suing javascript ? this includes when clicking on the Browser Back button too. ...

Fetch Latitude Longitude by passing postcodes to maps.google.com using Javascript

Hello All... I have Postcode in my large database, which contains values like SL5 9JH, LU1 3TQ etc. Now when I am pasting above postcode to maps.google.com it's pointing to a perfect location.. My requirement is like I want to pass post codes to maps.google.com and it should return a related latitude and longitude of that pointed loca...