javascript

Find non-active CSS properties

Is it possible to determine styles in a CSS file through Javascript? I am trying to detect CSS properties that will be applied to an element in a certain state, :hover in this case, but without those properties currently being active on the element. I had thought about cloning the element, appending the clone as a sibling with display:n...

Get Client IP using just Javascript?

I need to somehow pull the clients IP address using pure javascript, no server side code, not even SSI. Any ideas? I'm not against using a free 3rd party script, if someone can suggest one. This is an emergency stop gap until we can deploy new code. ...

jQuery Hide using ID

I'm trying to change the border color of an image using its id with jquery ( photo['id'] is passed in from a previous function ) the ids of the photos are of the form 'photo239839' $('#photo'+photo['id']+'').click(function(){ $('#photo'+photo['id']+'').css('border-color','#777'); }); When I try to use this same code usi...

Passing variables with jQuery

Hi, i'm relatively new to jquery and javascript and am trying to pass a unique id (number) into a flickr search function (jquery.flickr-1.0-js) like so, (number is the variable where i'm storing the unique id) <script type="text/javascript" src="javascripts/jquery.flickr-1.0.js"></script> <script type="text/javascript"> jQuery(func...

Passing Value to Javascript from Php

Dear all , I have php code of the following <?php echo "<SCRIPT LANGUAGE='javascript'>add dd_Employee('".$id1."','".$fname1."',".$sal1.");</SCRIPT>"; echo "<SCRIPT LANGUAGE='javascript'>add dd_Employee('".$id2."','".$fname2."',".$sal2.");</SCRIPT>"; .... ?> ... And My javascript Code Contains var details=new Array(); function...

jQuery ajax calling javascript function

Dear all, I am using JQuery And Ajax. My MainFile has the following code: <html> <head> <script src="Myscript.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $.ajax({ type:'POST', url: 'a...

PopupWindow in JQuery

Dear all, I am need of popupwindow with option of radio button ,I have tested with impromtu . Is any EasyMade Popupwindow plugin available,My Plugin should work all IE,Mozilla and Chrome, Any suggestion and Sample code. ...

cross-site XmlHttpRequest in Firefox?

I understand (I think) that XmlHttpRequest objects adhere to the "same-domain" policy. However, I want to create a simple (POC) local html file that downloads XML from a web server and does something with it (let's start with a simple "alert()"). Is it possible at all? Do I need a special Firefox config option? The server from which I'...

Modal dialog box which opens new page using jQuery

I see lot of example opening popup with jquery but don't see anything that will let me open new page in popup(modal dialog box). Any help is appreciated. What i am trying to do is when click on item it will open item description page in model dialog box calling an url for detail page. I am using asp.net, would like to use jquery if has...

How to handle JSON encoded strings using jQuery

I am currently using Django to construct JSON encoded objects which a retrieved using jQuery.getJSON(). The standard simplejson encoder encodes strings according to the JSON "standard", i.e. any string containing a '/' is translated to '\/'. Therefore if one of my parameters is a url, e.g. http://example.com/image.jpg it is passed to t...

Scale div vertically until all content is shown?

I have a div with a set height of 200, and sometimes there's enough content inside to have to scroll. Is there any way to be able to scale/grow the div until there's no overflow in Scriptaculous? Edit: I looked at the wiki, especially at Effect.Scale (which seems like the one I want) but I couldn't find a way to do what I'd like. ...

Best way to transfer an array between PHP and Javascript

So I have an array of records retreived from a database. The array is in the format; $rows[0]['id']=1; $rows[0]['title']='Abc'; $rows[0]['time_left']=200; $rows[1]['id']=2; $rows[1]['title']='XYZ'; $rows[1]['time_left']=300; //And so on upto 10-20 rows What's the best/most elegant way of transferring this array over to my javascript...

Google Chrome: JavaScript Error Message ...

When using Google Chrome, I receive the following error message: Error: Uncaught SyntaxError: Unexpected token < It occurs directly after my doctype declaration at the top of my HTML page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; Any ideas what this...

Javascript dropdown

I did a dropdown using JavaScript where on mouseover the dropdown opens. Now since i am using it in a side menu, i would like that when i go over the dropdown, instead of the dropdown items get over the items underneath, i would like that the items underneath move lower to make space. I managed to achieve this by removing the overflow i...

jquery select class inside parent div

I'm trying to change the alt of the image i'm clicking by selecting the image's class 'add_answer' Note: .add_answer shows up multiple times inside different containing div's jQuery(function(){ // Add Answer jQuery(".add_answer").click(function(){ var count = $(this).attr("alt"); count++; $('.a_type_'+count+'').show(); ...

Passing data to a jQuery UI Dialog

I'm developing an ASP.Net MVC site and on it I list some bookings from a database query in a table with an ActionLink to cancel the booking on a specific row with a certain BookingId like this: My bookings <table cellspacing="3"> <thead> <tr style="font-weight: bold;"> <td>Date</t...

jQuery .load seems to be running at an unexpected point

So I'm trying to load some returned html from an .aspx page but a click event needs to fire before it doing some stuff that the AJAX request depends upon. More specifically, I'm doing this. When a user types in a text field this function is run... function KeyPress() { $("#" + HiddenButtonId).click(); $("#test").load("TempJumpToAJ...

Which JavaScript framework (jQuery vs Dojo vs ... )?

There are a few JavaScript frameworks/toolsets out there, such as: jQuery; Dojo; Prototype; YUI; MooTools; ExtJS; SmartClient; and others I'm sure. It certainly seems that jQuery is ascendant in terms of mindshare at the moment. For example, Microsoft (ASP.NET MVC) and Nokia will use it. I also found this performance comparison of ...

What's the best way to do javascript validation on ASP.Net page with Masterpage?

I am implementing Javascript Validation on an ASP.Net page that is inside a Master Page. The control IDs are changing, so I can't use the original control IDs for validation. I looked on the Net and got the suggestion to build the script dynamically, and add it to the page using RegisterStartupScript. I don't like that solution because i...

Ajax - Library or Plain Javascript

I've been doing a lot of reading about AJAX, and wanted to know which is the better way to approach things: by using a library such as jQuery using their built-in methods or creating JavaScript without a library for AJAX? ...