javascript

Function won't execute

Hi guys. I'm trying to create a function that will execute on a click, on the condition that a variable is set to 0; However, the function will not execute, even if the variable is set to 0. (I am using jquery) var menuVisible = 0 ; $('#links').click(function(){ if (menuVisible = 0) { $('#subMenu').show("slow") ; ...

How do you stop and then start / trigger an event with JQuery?

I'm trying to stop the default action when a link is clicked. Then I ask for confirmation and if confirmed I want to continue the event. How do I do this? I can stop the event but can't start it. Here's what I have so far: $(document).ready(function(){ $(".del").click(function(event) { event.preventDefault(); if (confirm('...

javascript problem

Hi All, on click of a button I am changing window.location.href i.e. I am adding one query string parameter.This causes the page to be refreshed[as i am changing window.location.href]. I want to know is it possible to stop this page refresh and append the query string in the url? ...

Can anyone explain the difference between closure and anonymous functions?

I am relatively new to Javascript. I understand the concept of anonymous functions - but closures seem less clear. The similarity between the two (in my mind atleast), is confusing. Could someone explain the difference? (preferrably, with some code snippet, to illustrate the points clearer). ...

how to integrate javascript in iPhone application?

i am new in iphone application and i want to integrate the javascript so would you please give some information about how to implement javascript? ...

JQGrid sorting on client side

I have tree-grid with autoloading nows. The goal is to sort the grid by tree column, right on client side. But each time I click on sort column header, it issues ajax call for sorting – but all I need is on-place sorting using the local data. Do I have incorrect grid parameters or tree doesn't work with client-side sorting on tree colu...

not display the button in jSP

I want to hide and show the table row based on a condition. The id of my atable row is showhide2. This is my part of code to use show/hide the row <%if(group.equals("Y")){%> <input<% try{if(dTO.getStat() == 0){%> style="display:none;" <%}}catch(Exception ex){} %> type="button" value="View" id="btnview" name="bt...

Javascript trouble parseFloat and if/ else loop

So working on some code and I'm not spotting the issue with my loop in the second function it keeps returning 40, I think the loop is written correctly. I'm guessing its the value passed within the if and else condition? if (par_hour < 40) which comes from parseFloat function addEmployee() { var employees = new Array(); employees[0]...

Ajax/PHP contact form not able to send mail

The funny thing is it did work for one evening. I contacted my host, and they are saying there's no reason it should not be working. I have also attempted to test it in Firebug, but it seemed to be sending. And I specifically put the email address (hosted in my domain) on my email safe list, so that is not the culprit either. Would anyo...

Find checkbox values from Dynamically generated Divs in php using javascript...

How to find checkbox values from Dynamically generated Divs in php using javascript? Here is my code, echo "<input type='text' name='chkID' id='chkID'> <div id='mainDiv'>"; while($rowset = mysql_fetch_array($result)) { echo "<div style='float:left; width=10px; border:solid 1px;'> <input type='checkbox' value =".$rowset[0...

Is there any way to have some javascript (such as a Bookmarklet) autorun on page load?

To execute bookmarklet code the bookmarklet needs to be actioned by the user. Is there any way to have a bookmarklet or indeed any javascript run automatically on page load? Or is an Add-on the way to go? Thanks ...

How to use JSP tags in JavaScript?

How to use JSP tags in JavaScript file? Is there any way? ...

Why is __caller__ unsafe?

The following seems to be a reasonable use of __caller__: var foo=1; function a() { var foo=2; function b() { var foo=3; foo; // 3 this.foo; // 1, from global __caller__.foo // 2 } b(); } a(); // creates a's execution context However, __caller__ is not available. Why not? If the global c...

IE doesn't find hidden-field values created with JS

Hi, I have a page with a few hidden fields in it. Those get filled with values by a script (JS/jQuery) when the user has finished selecting a couple of options. Now, if I click a link on that page, go to the linked page and then hit the back-button, FF and Safari are able to read out the values of the hidden fields. So the function to ...

Detect target treenode when dragging items to the TreePanel instance

I have GridPanel and TreePanel instances. Elements from GridPanel could be dragged into the treepanel. But I can't detect which tree node receives these dragged items. I initialize tree panel DD with the following code (method of class derived from Ext.tree.TreePanel): initDD: function() { var treePanelDropTargetEl = this.getEl(); ...

How to change li position using Jquery

hello i have this code <ul> <li id="1"> <li id="2"> <li id="3"> <li id="4"> <li id="5"> <li id="6"> <li id="7"> </ul> i want to make a function that foreach time the function is called the first li at the top will be the last one so the first example will look like this <ul> <li id="2"> <li id="3"> <li id="4"> <li id="5"> <li id="6...

Cross domain requests: Javascript vs Flash

As you might know, browser's security model does not allow a script loaded in a page from http://www.example.com to make cross-domain requests (no AJAX calls to any other domain other than www.example.com). The Javascript file itself could have been served from a different domain altogether (www.javascript.com/myscript.js) and that is ir...

how to make the parent window blank during the onload ??

When i type the URL in the browser the login.jsp gets evaluated and a child window(with diasabled toolbar ) is opened and the parent window gets closed. wat i want is when i type the url in the browser and click go i dont want to display any information of login.jsp page to be dispalyed in the parent window.. i want only in the child wi...

Remove null values from javascript array

Hi, I am having a javascript array. addresses = new Array(document.client.cli_Build.value, document.client.cli_Address.value, document.client.cli_City.value, document.client.cli_State.value, document.client.cli_Postcode.value, document.client.cli_Country.value); document.client.cli_PostalAddress.value = address...

Classic post request vs ajax request

I have a table with some items. I select one and when i click a button i want to send its id in the server side and based on that id to create some excel file. To send the id from the client should i use a classic post(create a form, assign to id a hidden, submit it and destroy it) or should i use $.post from jquery(or any other ajax) Wh...