javascript

how to open another window and close the window that calls it

I have this code in userpage.php: <script langauge="JavaScript"><!-- function newWindow(fileName,windowName) { msgWindow=window.open(fileName,windowName); } //--></script> <a href="javascript:newWindow('1.html','window1')">Logout</a> And this code at index.php: <script language="JavaScript"><!-- function newWindow(fileName,windowNam...

how to stop page redirect

I need to stop all the page redirection thro' javascript. I have some script which will redirect the page to some other location. How can i stop all the page redirection in my page thro' jquery or javascript. ...

using javascript onchange to fill a calendar

i have a calendar and a textbox in my c# asp.net application. when a user enters a date in the textbox, the selected date in the calendar should become the date entered in the text box. the hard part is that i need to do this in javascript. what i have now is this: <asp:TextBox ID="txtDate" runat="server" onchange="javascript: Changed...

Javascript confirm before running the eventhandler, which deletes records from the databse

Hi I have button, which fires an event, that deletes a record from the database. This is the source of the button: <asp:Button ID="btnDelete" runat="server" Text="Delete" onclick="btnDelete_Click" /> But how can I make a confirm box appear before the deletion? ...

Javascript - value of document.write(false == null)

What is the value of document.write(false == null). It should be true right (converted to same type before comparing - null is converted to false), if null is false then comparision should return true, but printing false. Why? ...

Javascript plugin creation

I want to create a plugin called 'myPlugin'. Which method should I use and what is the difference between these two methods? Please tell me the advantages too. I am from designing background and not much programming knowledge. var myPlugin = { myId:"testId", create:function(){}, destroy:function(){} } OR funct...

Open layers multiple mouseover events for multiple markers

I have the following loop inside an function init(); which is executed "onload", I am having traouble attaching the mouseover event for each marker, the alert i always returns the value of the final loop/iteration (228)? for(i=0; i<document.getElementById('departureSelect').options.length; i++){ var coords = eval(document.ge...

accessing php javascript object in asp.net user control

Hi, I have a website in php which is using 4 frames(top, left, middle and right). The middle frame contains the web user control coded in asp.net. Now, in the right frame( which is coded in php ) some javascript contains the id of the items selected in right frame. I need to get those ids to the middle frame on asp.net user control. Ho...

How can I prevent a double submit with jQuery or Javascript?

Hi guys, I keep getting duplicate entries in my database because of impatient users clicking the submit button multiple times. I googled and googled and found a few scripts, but none of them seem to be sufficient. How can I prevent these duplicate entries from occurring using javascript or preferably jQuery? Thanx in advance! ...

Javascript Click/Drag and Select Table rows and columns

Hi, I am wondering if anyone knows a java script library that would add a "select" type of functionality as seen in excel/google docs where you can click and select several different parts of a row and/or column. I am looking at adding this functionality to my web application. Does anyone know where of library's preferably in java sc...

javascript: capturing load event on LINK

hello everyone, i'm trying to attach an event handler to the load event of a link tag, to execute some code after a stylesheet has loaded. new_element = document.createElement('link'); new_element.type = 'text/css'; new_element.rel = 'stylesheet'; new_element.href = 'http://domain.tld/file.css'; new_element.addEventListener('load', fun...

Ajax backed List/Menu

Hi all, I am developing a web application using Spring JS and Dojo Toolkit. In this application I want a Menu that lists the different organzational units in my application. The users will be able to add/remove these units and I want the menu to immediately reflect those changes. Example: My user adds an new organizational unit "Strat...

parsing JSON in java ?

How to parsing JSON in java? { "code": 100, "message": "SUCCESS", "result": { "list": [ { "cardNumber": "ALUFZZ5SZ1Q5", "expireTime": 1270742400, "surplusThreshold": 4, "uid": 771292, "useTime": 1270214375, "wa...

Jquery Sticky Tabs

Hi Guys, I have searched through this entire site but i couldn't find what i was looking for. I am using Jquery UI tabs and i try to keep the page on the selected tabs when the page is refreshed. This is what i got: $(document).ready(function() { var cookieName = 'stickyTab'; $('#tabs').tabs({ selected: ($.cookies.get(cookieNa...

How can ZK Javascript can be followed to find actual file?

Hello, I want to follow ZK javascript code to obtain XML results. In the website when a country selected, another selectbox for states is populated by using ZK and i tried to find the actual address such as http://cc.com/getState?countryID=46 but I've lost within the ZK. Is there a way to reach the actual URL? Thanks. ...

Embed external images for use in HTML canvas?

I'm using JavaScript to load an image into my Canvas element in Firefox. This works fine for local images, but throws a security exception for external images. Is there any way to avoid this security exception, one that does not involve my server having to act as proxy to load the image locally (because that would stress my server)? PS:...

Forced to use too many hidden fields; looking for an alternative approach

I am looking for a better approach to do this. I have around 70 to 80 hidden fields in my page. This hidden fields are initialized at the server side and then used at the client side for validations, calculations, etc,. using java script. I wanted to know if there is any other alternative approach to using hidden fields in asp.net. I g...

javascript xml saving problem

hi there, I want to modify some data on XML file residing on server side by using javascript. I'm using following code var xh; if(window.XMLHttpRequest) { xh=new XMLHttpRequest(); } else { xh=new ActiveXObject("Microsoft.XMLHTTP"); } xh.open("get","books.xml",false); xh.send(""); var xdoc=xh.responseXML; var x=xdoc.getElements...

How to enable 'wget' to download the whole content of HTML with Javascript

I have a site which I want to download using Unix wget. If you look at the source code and content of the file it contain section called SUMMARY. However after issuing a wget command like this: wget -O downdloadedtext.txt http://www.ncbi.nlm.nih.gov/IEB/Research/Acembly/av.cgi?db=mouse&amp;c=gene&amp;a=fiche&amp;l=2610008E11Rik ...

Javascript plugin creation methods

I want to create a plugin 'myPlugin' which simply add some text to a div. like: document.getElementById('testDiv').myPlugin("this is a text"); how can I achieve this through singleton method as well as prototype method ? ...