javascript

Javascript on iPhone Web App: JSON for loop not displayed

I have the following code to display JSON results from an AJAX request as an unordered list. It works well enough in Safari but on Mobile Safari on the iPhone the raw data displays but the UL does not. In fact the for loop isn't triggered. $("#results").append(data); var songdata = JSON.parse(data); var i = 0; for (i=0;i<=songdata.to...

How do I pass the # symbol as part of a GET querystring in the URL?

I am using javascript (using jquery) to pass a # symbol as a GET parameter via AJAX call. The problem right now is that the # symbol is breaking up my querystring. Any help appreciated. Thanks! ...

Javascript: JSON 'for loop'

The following Javascript displays in Safari but not Mobile Safari. Can anyone see any bugs? $("#results").append(data); var songdata = JSON.parse(data); var i = 0; for (i=0;i<=songdata.total;i++) { alert(i); var songhtml = "<ul><li><img src=\"" + songdata.data[i].artwork + "\" /></li><li>" + songdata.data[i].title + "</li><li...

Toolbar items added/inserted into Ext.ToolBar aren't showing on the page.

I have a custom component that extends a panel. The panel has a top tool bar with a basic config. I want to be able to add items to the panel dynamically after it has been created. Those items should always come at the end of the main set of menu items and before the filler that pushes the logout button to the far right, so I wrote the ...

jquery populate select box with key:value pair?

I am using jquery to the server code returns the following values 0:SELECT ONE;1:VALUE1;2:VALUE2 etc how do i populate this into a select box? var="0:SELECT ONE;1:VALUE1;2:VALUE2"; $("#targetSelectBox"). ??????? ...

Stream publishing in Facebook Connect

I would like to publish streams on an external Facebook Connect website. This should be done via the JavaScript client library which I've already included. The code of my page is as follows: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1...

how to to scroll smoothly between divs without jquery

i want to to scroll up and down a page with javascript smoothly. i have follow some code on this page- http://www.xfunda.com/index.php?view=article&amp;id=55%3Ajavascript-page-scroll-scroll-a-web-page-from-bottom-to-top-smoothly&amp;option=com_content&amp;Itemid=75 but this only goes up, im quite confused on hot to get to specific div...

Google Maps based benchmark for browsers?

Anyone knows if there is any benchmark done to browsers in a "google maps" test suite? Google Maps with lots of markers and data can really get slow so maybe this was an interesting "real world" benchmark that stresses javascript / DOM management in browsers :) ...

Ajax script only returns results sometimes?

I have a script running on xampp and when I run this script with alert call in it the file executes but when I run it without alerts it just sits there and doesnt return anything. What am I doing wrong? Code: var xhr; function getPlants(xhr){ try { xhr=new XMLHttpRequest(); }catch(microsoft){ ...

jquery easyslide help

Hello I am intergrating the easyslider plugin into my website, I was hoping somebody will have come across my problem, I am using the paginate version of it so I can navigate in the slideshow to any image, however using the paginator then pauses the slideshow, does any one know how I can stop it from pausing and just carry one from the s...

Is there any other better way than this (modernizr 7 KB javascript) to make round corner for IE 6, IE 7, IE 8?

http://www.modernizr.com/docs/#borderradius only 8KB in size. ...

jquery append not working in IE works fine in FF.

this code works fine in FF, not in IE. var target = $("#targetSelectBox") var vals = values.split(";"); for (var i = 0; i < vals.length; i++) { var parts = vals[i].split(":"); target.append($('<option />').val(parts[0].trim()).text(parts[1].trim())); } ...

Is referencing jQuery from ajax.googleapis.com bad practice?

I've seen it recommended to reference jQuery via: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt; </script> The idea being most people already have a cached copy on their client. What if a hacker replaces that file on google's server? They could do an infinite number of "e...

Allowing Arbritary Embeds / Javascript

Hello, I'm playing with ways to allow users to insert embedded objects safely into content. What I'm doing now is essentially the following: 1) parser for youtube embed code 2) get video id, remove all other embed code 3) rebuild youtube embed code with video id This seems to work pretty well, and should be safe. Problem, I'd essent...

CSS Style Visibility not behaving as expected

I have a html page with a basic tab control. I use javascript to show and hide tabs and tab content divs. My problem is that if I change the visibility of an element inside one of the tab content divs to 'hidden', then back to 'visible', the element seems to forget or lose its parent div container and remains visible, regardless of its o...

Plane equation from a line

All right, I need to do two things: I need to determine the equation of a line, with the angle given, from a point in 3D space I need to determine the equation of a plane that is perpendicular to that line, and is a set size, with the original line in it's center. I will need the plane's equation to be in a form where, given a new li...

UpdateProgress Control - How to improve its responsiveness?

I'm using the UpdateProgress control in ASP.NET. My question is simply how do I improve it's responsiveness? It doesn't consistently show up if at all. I would use JQuery to simulate the effect but I'm trying to avoid introducing tons of javascript because it's a webforms application. Thanks for your help! ...

Attribute selectors, JavaScript and IE8

I'm attempting to use attribute selectors and CSS for formatting elements. The HTML looks like: <div id="user" highlight="false">User Name</div> The CSS is: [highlight=true] { background-color: red; } [highlight=false] { background-color: white; } And then there's some accompanying JavaScript: if( foo ) { node.setAtt...

How to get element by ID in IE? (Visual Studio 8?)

Using document.GetElementById(thingieID) doesn't seem to work. Can anyone help this DOM newbie? ...

How does jQuery deserialize JSON?

I am using jQuery.ajax(...) to retrieve JSON data from an ASP.NET MVC service. When the server encounters an exception, I send a 400 Bad Request status back to the client and send my exception as a JsonResult: Response.StatusCode = 400; return Json(new { ex.Message, ex.StackTrace }); And here's my jQuery code: $.ajax( { type: "PO...