javascript

facebook connect for mobile ?auth_token

hey i am building mobile website and i want to integrate facebook connect. in my regulat site i am using facebook connect that uses the cookie for getting the session key, on mobile this cookies method for getting the session is not recommended, i think. what ivgot so far is that i call to login rest server and then it return to me...

IE onClick will not check a checkbox unless you click the image in the label?

Ok, I have a label, inside this label is a div, which contains an image, and some text. The div has an onClick call to a javascript function, that changes the color of the div inside the label, and also checks the checkbox (for some reason, IE and firefox didn't want to check it correctly, chrome worked fine). Javascript: <script langua...

Scope of javascript variable declared inline

Here are the problem scripts: This is from the HTML file: <script type="text/javascript"> var devices_record = "some string"; </script> <script type="text/javascript" src="/js/foo.js"></script> This is from foo.js: function bar () { devices_record = "assign new string"; } The error report by HttpFox is that devices_ record...

Having problems creating an array from XML data in Acrobat Javascript, please help if you can

I have a manually created array that already works example below: var PartsData = { 179: { ref:"", partNum: "201-2007-C00-00", descript: "System Monitor Card (Tracewell Only)", cage: "39764", qty: "1", SMR: "XBOZZ...

Create an array for simpleGallery (jquery plugin)

I am using the jquery plugin simplegallery (http://www.dynamicdrive.com/dynamicindex4/simplegallery.htm). out of the box it works like their documentation says. However I want to use it in a way that gets a dynamic list of random images from the server via an ajax call so that the list is different each time the page is loaded. On the se...

Div Background Image

Hi All, I am working in Mojo SDK which is used to develop Apps for Palm Pre webOS. I am trying to add an image to the background of the div dynamically and fade it out. I am using the following code to set background of the div dynamically: this.controller.get("imageDiv").backgroundImage = "url(../images/marks/mark-" + this.markNo + "...

check browser css property support

Is it possible in javascript to know if a css property is supported by the client browser? I'm talking about the rotation properties of css3, i want to execute some functions only if the browser supports them. ...

Capturing distinct keypresses

Hi! When you hold down a key, the JQuery events start to pop out like crazy for this single key press: ... keydown keypress keyup keydown keypress keyup ... Is there any (even non-browser-portable) way to capture only one event for each key pressed (example: press A and hold it down, and this should yield only one function call)? Ch...

change active li when clicking a link jquery

hey I want to make a menu, and change the class when clicking. When i click on the "li" with no class="active", i want jquery to add a class on the empty <li> and remove it from the othes "li". <li class="active"><a href="javascript:;" onclick="$.data.load(1);">data</a></li> <li><a href="javascript:;" onclick="$.data.load(2);">data...

How to check element's visibility via javascript?

Hi I'm interested in a way to check whether an element has display:none style explicility (ie style="display:none"), has a class that has (or inherits) this style, or one of its parents is hidden (and my element inherits this) Case1: <body><div><span style="display:none;">Some hidden text</span></div> or <body><div style="display:n...

Checking Checkboxes scattered on the same page

I have 10 checkboxes that are scattered throughout a page and if any one of them is checked, then a div needs to have it's display set to block. However if they are all unchecked then the div is set back to display:none. They are in different parts of the page and I am having problems figuring out how to detect the check. Thanks, -Seth...

javascript and ajax load, then effects

Hi, I have a javascript code, whereby I'm trying to load a list from a separate page (using jQuery's load() function), slide the current list out and slide the new list in. Now, I don't want the old list to slide until after the new list has been completely loaded. Can anyone tell me how to achieve this without looking like the script i...

Javascript/CSS Menu to replace contents in a specific area...

Im looking for a script or tutorial that shows how to create a menu similar to the one from a Firefox first run page: http://www.mozilla.com/en-US/firefox/2.0.0.6/firstrun/ When you click a nav menu item on the left, the contents scroll into position in the main content area right of the menu items. Any ideas on this one? ...

Nytimes-style popup when the user makes a selection

When you select text in an article on nytimes.com this little ? pops up at the end your selection: What's the best way to implement something like this on my site? Are there any pre-rolled libraries for doing this? ...

iframe undefined in Greasemonkey script

I have created a Greasemonkey script that runs fine in the firebug editor, with the Greasemonkey specifics removed, but not when I try to package it as a userscript. The Firefox error console is reporting that an iframe I am trying to use is undefined. I've cut the userscript down to a minimum case where it should be printing the ifram...

jCarousel External Event Control

I have been trying to work with a jCarousel external control, but in a way I am finding no examples for. I have 2 objects on my page, a Cycle control called BackgroundContainer and a jCarousel control called mycarousel. What I would like is when the Cycle control fires a change then to have the AFTER event of the Cycle control change t...

Single javascript function for multiple web pages

Hi there, I have around 40 aspx pages in my website. I want to use a javascript function which needs to be called when any of the 40 pages is loaded. something like I could have this function in the "head" section of each of the 40 aspx pages and then call in the body onload event. But I would like to have this function at a single pl...

Pass variable to external JS file?

Hi SO: Is it possible to pass a variable to a linked .js file? I tried this: <sf:JsFileLink ID="JQueryLoader" runat="server" ScriptType="Custom" FileName="~/Files/Scripts/rotatorLoader.js?timeout=1000" /> But firebug is telling me that timeout is not defined. Here is the code for that .js file: $(document).ready(function() { $("...

jQuery.get() Help

What's wrong with this function: function() { $.get('/controller/action', function(data) { $('#temporaryPhotos').text(data); } ); return false; } What it should do is fetch HTML from /controller/action page and insert the HTML into the #temporaryPhotos div on the current page. Initial markup looks like this: <div...

Internet Explorer takes considerably more time to load than FireFox-- to the point where it actually freezes. How can I prevent this?

Hi, One of our main pages takes an immense amount of time to load in IE8 (have not tried IE7 or 6). It's so bad that IE actually freezes up for a few seconds while trying to load the page. Firefox is perfectly fine... I've tried a bunch of different things but I cannot figure out what it is. It's not very js intensive, although we ar...