I want to call various functions made in PHP from my javascript file. Normally using Jquery.post we call a PHP file and and pass various values as post.
function new_user(auth_type, tr_id, user_name, email)
{
$.post("bookmark.php",{AuthType:auth_type, TR_Id:tr_id, UserName:user_name, UserEmail:email});
}
If I want to c...
how do I detect whether windows is in high contrast mode, or it displays large font or extra large font?
I need to provide accessibility support in my javascript.
Thanks.
...
Hi All
If I have the following code in two functions of an object:
add: function()
{
// create trip.
var trip = new Trip();
// add the trip using its id.
this.trips[trip.id] = trip;
},
remove: function(tripId)
{
// remove trip.
delete this.trips[tripId];
}
NOTE: The constructor for the Trip object binds a bu...
I am trying to transform a set of two radio buttons in a stack of two labels, one blue and on gray representing, respectively, the selected radio and the unselected one. Clicking on this stack will change which of the labels is blue (and which of the radio buttons is checked). It works well but it breaks down in an ugly manner when the t...
Forgive my ignorance since this seems like its something I should know by now.
I know I could make a stylesheet that will allow me to make changes in my CSS throughout several pages that use the CSS. I also know that you can make an external javascript file that could contain functions you want to reuse. But lets say I had pure HTML con...
I am attempting to catch the last case in a forEach loop, but all cases seem to evaluate to false instead of the last one being true. My code:
for(var i in networks){
if (i == (networks.length - 1)){
//do stuff
}
}
What is going wrong?
...
i've tried several different variations of finding the length of a select element and nothing's working! i can't figure out why, since several websites list this is as the correct code.
here's the javascript:
<script type="text/javascript">
alert(document.getElementById("opentimes").options.length);
</script>
and here's the form...
What's the easiest way to convert a floating point number to its binary representation in Javascript? (e.g. 1.0 -> 0x3F800000).
I have tried to do it manually, and this works to some extent (with usual numbers), but it fails for very big or very small numbers (no range checking) and for special cases (NaN, infinity, etc.):
function flo...
In my JSP page, i am using
response.sendRedirect(..) to redirect to an HTML page.
Is it possible to use javascript to detect whether a redirect occurred versus a page reload?
Thanks.
...
I am testing out the Jquery droppable photo manager demo:
http://jqueryui.com/demos/droppable/#photo-manager
Currently when the photo is deleted it is moved to the trash bin. How can I have it copy the image and move it to the trash bin so that it appears in both places??
This is the code:
<script type="text/javascript">
$(fu...
I am using the Google contacts api to retrieve contacts. That works FINE. I have been asked to get the groups that each contact is associated with and whatever I tried seem to have failed me. I am not going to post my code here but assume it works (other than the group stuff). I am iterating through **result.feed.entry** where my contact...
What will be the best way using javascript regular expression to get numbers out of text..
e.g.... I have "$4,320 text/followme" and I want to get 4320 out of this. However I want to avoid numbers after first occourance of an alphabet or any non alphabet other than a comma ','
so that if i have $4,320 t234ext/followme it will still ret...
I'd like to pass a variable into the key of my monthHash variable here:
var monthHash = new Array();
monthHash["JAN"] = "Jan";
monthHash["FEB"] = "Feb";
...
monthHash["NOV"] = "Nov";
monthHash["DEV"] = "Dec";
Such that I can do this:
alert(monthHash[the_variable]);
Instead of using a switch case to go through this.
When...
I can't figure out why this isn't working. It changes to the first link and wont keep going. I'd also need it to loop through so when you click it always circles through the links I have a php variable that is the last #panelNum.
<html>
<head>
<script language="JavaScript"><!--
function findLinkByHref(href) {
for (var i=0; i<document....
Now here's a fun problem. I have an object array as the following:
objRequests = [
{
url: "/cgi-bin/script1.cgi",
dest: "#div1"
},
{
url: "/cgi-bin/script1.cgi",
dest: "#div2"
}
];
Now, I iterate through these objects to load some information from the server at particular addresses using jQuery's $....
I am using a dojox.grid.DataGrid with a dojox.data.QueryReadStore. As the user scrolls the grid, the grid lazy loads rows from the store and keeps them in memory. Using Firefox on Linux or IE 7 or 8 on Windows, it appears that these rows are never cleared, and the footprint of the browser window will continue to grow (as observed in to...
I am currently battling an IE JavaScript/DOM bug (what fun) and it has truly stumped me. The code in question copies some checkboxes into a form and needs to maintain their checked state. Problem is, IE (specifically IE8, though I'm guessing others as well) doesn't want to do that.
I've narrowed down the bug itself to a very small tes...
I run a local blog, and I would like to offer advertisers the ability to buy ads knowing all of the impressions will be from the local community. For everyone else I want it to show typical google ads.
My questions are:
How feasible is this?
Is there any readily available code or service that can do something like this?
The cheaper t...
Hey guys and girls
I need your opinions and knowledge on a subject.
I'm developing on a website that uses a good amount of JavaScript. In a script tag at the end of the body tag I call a PHP file, which gathers all my JS files and combines/compresses them into one (shorter) file, so I can reduce the number of HTTP calls to the server.
...
See the code here on jsbin. I'm basically trying to create a series of switches. Each filled red square can be dragged up and down. The red outlines on the bottom are drop zones. When a square is dragged over a drop zone that is eligible to accept it the drop zone should turn pink.
There are two problems with this code. One is that whil...