I am attempting to enhance a internal web application we use. I am using a custom favelet to autopopulate certain fields. The javascript variables I need to populate a form exist on a different HTML page internally. Is it possible to access vars from another html page? They would be embedded in the external pages document element.
I do ...
Is it possible to send post-variables with javascript?
I want id to be sent with post, not get.
window.location.href="hanteraTaBortAnvandare.php?id=10";
...
A problem I regularly come across writing javascript using jQuery is that when a method of an object involves adding an event listener 'this' changes from being a reference to the object, to being a reference to the DOM element that triggered the event.
Currently if I want to refer to the object from within the event handler I do someth...
I have a scheduling page that display a week (sunday to saturday) schedule.
They way I want to add employees to this schedule is with a series of popup menus that change based on the values selected.
For example the first menu will be Jobs with <option> values propagated from the jobs table in my db.
Now say a user selects 'Cook' in t...
How can you make a javascript variable and use it with jQuery?
I use the following command unsuccessfully in trying to get the POST data out of the var answer. I can access the variable in HTML by $_POST['answer'].
var answer = $('#answer').val();
I use this variable in this code
jQuery('div.answer_' + $answer + ' a.delete_answer')
...
Hi,
there is an alternative to the Javascript onUnload? I use JSP Jakarta Struts framework with a Servlets.
I must know, when is window closing, because not everyone clicks on Logout button.
How do you handle it in your applications?
...
I have a JS script with tons of functions, on big on is this:
function id(i) {
if(document.getElementById)
return document.getElementById(i);
return;
}
It just saves me many bytes in typing out document.getElementById() each time.
My problem is I frequently add and remove classes and other attributes from elements.
I w...
I just found Dean Edwards javascript packer here:
http://dean.edwards.name/packer/
It has a couple of options,
Base62 encode
Shrink variables
To test it I took the latest version of jquery that is already minified to 56kb and ran it on that page above with shrink variables, the result is the same size file, 56kb.
I then ran ...
I will try to explain the situation as it is a little bit more complicated.
I have created a multiple picture upload form. It works like this:
In the form there are 2 submit buttons. 1 normal HTML submit button and another one is generated by jQuery. It is a "Browse" button which allows you to browse pictures on your HDD and add them ...
I am using Google Maps API to get the distance between 2 UK postcodes.
var yourPostcode = $("#YourPostcode").val();
var restaurantPostcode = $("#Postcode").val();
var point1 = GetPointFromPostcode(yourPostcode);
var point2 = GetPointFromPostcode(restaurantPostcode);
var distance = point1.distanceFrom(po...
I was looking to implement such menu as
http://www.fogcreek.com/FogBugz/learnmore.html (Left hand side)
Can anyone recommence some plug-in for jquery, or any other JavaScript library which behave same as above site?
...
Actually in the center of current view, above all other objects.
Cross-browser and without 3rd party plugins and etc.
Via CSS or Javascript
UPDATE:
I tried to use Javascript's Sys.UI.DomElement.setLocation() but this positioning object not in absolute location but relative to it's parent.
Is there a function to put in absolute locatio...
How do I dynamically change the height of a div.
Why does this not work:
var priceBarElement = $("priceBar");
priceBarElement.style.height = request.responseText+"px";
Which I hope to use to change the priceBar div which is given by this line further down.
<div id="priceBar" style="width:28px;margin-top:20px;background:#F00"></di...
I got a menu powered by SIFR like this:
<h2><a href="images/logo.jpg">IDENTIIES</a></h2><br>
I've setup the different states of the a:link style and I'd like this link to stay in another color when it has been clicked on (until another link is clicked on).
I think this has something to do with javascript, but I can't make this work.
...
Hey
I have an external file in php, outputed as json format
I want the data to be send back to jquery in arrays .... how to do it ?
php:
$options = "<option value="data0">data 0<option>
<option value="data1">data 1<option>
<option value="data2">data 2<option>
<option value="data3">data 3<option>
<option value="data4">data 4<option...
For the longest time I was considering using a Javascript bookmarklet to generate the passwords for the different sites I visit to avoid the problem of "similar passwords everywhere", yet still be portable. However, after reading this paper it became clear to me that using this method would mean that a single malicious page could comprom...
Is there something like serialize/unserialize PHP functions in jQuery?
These functions return a string representations of an array or an object which can than be decoded back into array/object.
http://sk2.php.net/serialize
...
A simplified version of problem I am experiencing:
Here is my HTML form:
<form enctype="multipart/form-data" method="post" action="/controller/action">
<input type="text" name="title" id="title" value="" class="input-text" />
<input type="hidden" name="hidden_field" value="" id="hidden_field" />
<input type="submit" name="submit_form" ...
Some time ago, people here helped me very well with code. Now I'm tasked with adding a small function:
I really like to count the winning numbers which are defined in picks.
Can somebody explain/edit the code for adding a extra column behind the last column with the total of green/winning numbers?
Here is the website: http://www.cold...
How can I check that a variable is a number, either an integer or a string digit?
In PHP I could do:
if (is_int($var)) {
echo '$var is integer';
}
Or:
if (is_numeric($var)) {
echo '$var is numeric';
}
How can I do it in jQuery/JavaScript?
...