javascript

How to use javascript or jquery to retrieve parameters from the url?

I have a url that looks like: http://www.my-site.com/#key=kj123asj. I would like to retrieve key using javascript. Any help is appreciated. ...

using ajax to call a url

Hello, I have a php script on my site (users_online.php) that shows how many people are connected to my server whenever the script is executed and I would like to display and update this information on my front page using javascript / ajax without refreshing the page is this possible ? Thanks, Kelly ...

Image script wont work in Chrome.

Hi all. I've just redesigned my website, and seemingly all is well. However someone has pointed out that the image galleries are not viewable correctly in chrome. It's driving me mad, and I can't work it out. Can anyone spot an obvious mistake? Thanks a lot. The URL is: http://www.create-imaginations.com/ ...

How to find a dynamically-generated HTML element?

I need to get the client-side instance of a RadComboBox (or the newly-selected value of a RadComboBox) when my RadGrid is leaving edit mode so I can post back the changed value to the server. The problem is, the client-side id of the object always changes. Also, the RadComboBoxes aren't created at runtime -- they're only created after ...

Utilizing Twitter's Streaming API w/ jQuery?

Twitter's Streaming API seems to provide a way to receive realtime tweets without constantly polling for new data. Would it be possible to make use of this API using jQuery (or maybe falling back to pure JS)? As far as I can tell, there's no built-in way for jQuery to stream an HTTP request with JSON. Is that correct, or did I miss some...

easiest way to pass the data in javascript

I have x = 65; in a javascript page /var/html/pag1.js and I want to pass x to a different page: /var/html/user1/pageUser.js What's the easiest way to send a value like that? Thanks. ...

Iterating through YQL JSON results in geo.places via javascript

I'm trying to iterate through some JSON results from the YQL geo.places table using the YQL jQuery plugin (http://plugins.jquery.com/project/jquery-yql) troubleshooting with the following code; $.yql("select * from geo.places where text=#{placename}", { placename: '90210' }, function(data) { var Results = data...

Check if each cell in a table is equal to the cell above.

How do you check in JS what the value of the td above the current one is in a table? I'm trying to get a table like this: |column1 | column2 | column3 | column4 | ---------------------------------------- | | | | | ---------------------------------------- | | | data | | ----------...

jquery $.ajax not returning value

I'm trying to get a return value from an ajax call but I keep getting "undefined" function getUserName(targetName){ $.ajax({ type: "GET", url: "http://servername/iMon/queryuser.pl?host="+targetName, dataType: "XML", success: function parseUserName(xml){ var userName = $(xml).find ('firstName').text()+' '+$(xml).find('lastName').text...

Convert PictureStream to HTML5 canvas

I am retrieving a byte array of a pictureStream from a .net webservice. the JSON byte array response looks like this: [137, 80, 78, 372, 617 more...] I am trying to convert this byte array and draw it into an HTML canvas like this var context = document.getElementById('boxcover').getContext('2d'); context.putImageData(movies.PictureS...

Radio button to populate text fields

Hello all, I'd the foll. requirement for one of my web applications: In my HTML table, some of the columns require user input as textfields. Next to the text field, I wanted to have a radio button on each row which populates rows meeting certain criteria in my table. Here's my code <td> <input type="text" id="newContact<%=rCo...

Securing SSJS against unverified code

I want to use node.js (or other SSJS solution), running my own code + external written code inside (untrusted). Any way to seperate and protect my own code? Could I limit the modules and system effect of th untrusted code (limit access to files, non HTTP ports, etc.)? ...

jquery abort() ajax request before sending another

Hello, Based on: http://stackoverflow.com/questions/446594/kill-ajax-requests-using-javascript-using-jquery... In inventory_search() - before the ajax request is made, how can I check for any current requests and abort() them before making a new request? Or... Is there a better way to do this? <script type="text/javascript"> $(fu...

How to show a hidden class for an element with javascript?

Hi there, I'm having trouble trying to show a hidden class that has already been applied to an element. I'm trying to use the show() method with the class and selected element, to no avail. Any help would be appreciated! HTML <label for="name" class="overlay required"><span>Name...</span></label> <input class="input-text" type="text" i...

Why Does Append Work Here But Add Does Not?

This question occurred to me after a user named patrick pointed out an error in an answer I'd given earlier today. Given the following html: <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"&gt;&lt;/script&gt; <script type="text/javascript"> $(function(){ ...

apply a click to parent of a tag (jquery)

I have alot of: <li><a href="google.com">LINKY</a></li> type links on my site and much prefere the whole Li to be clickable instead of just the text. So was thinking of applying some nice jquery that will hunt any $('li a') down and make it so when you click the <li> it will trigger the click on a <a> $('li a').each(function...

xml file as flashvars in SWFobject

I have a flash file with an xml file as flashvars. when I use this code it works in every browser, but not in IE 7 or higher. OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="530" HEIGHT="410" id="usa_locat...

function sending a null value to php file

Hey guys, I've got a function which sends the "id" value to a php file but all it's send is null.. can anyone spot why? (the value of id is not null) function send(point, name, message, type, file, id, lat, lng) { var html = "<b>" + name + "</b> <br/>" + message + '<IMG SRC=\"'+file+'\">' + ' <br> id = ' + id + "<a href=delete.php?id...

Regular Expression to find words (using word boundary) where words include a dash character

Given the following Regular Expression: \b(MyString|MyString-Dash)\b And the text: AString MyString MyString-Dash Running a match against the text never finds a match for the second thing (MyString-Dash) because the '-' (dash) character isn't a word boundary character. The following javascript always outputs "MyString,MyString" to t...

Java/JavaScript and frameworks

hi using html5/css3/javascript with some frameworks as sproutcore/gianduia as apple recommend for webapps developing (like apple's iworks.com, mobileme.com) is better or java?could i develop mid-scale webapps by javascripts especially that is mainly client-side language? is java better in server-side and OOP? thanks ...