javascript

Testing a slow connection

I am hearing of a report that my website crashes, when she is at home. She has not had a problem with the website in the past, and the only factor seems to come when she is at home, where her internet connection is dialup. My site is only 140KB, but it does use Scriptaculous and jsMath libraries. The latter one has an error when loa...

Haacked JQuery Undoable "Object doesn't support this property"

I refer to Phil Haack's "Undoable" article found here: http://haacked.com/archive/2010/01/01/jquery-undoable-plugin.aspx I've copied the exact mark-up for the table from the tables demo page, included JQuery 1.3.2 min, and copied the exact script block used on the demo page but when it gets to this bit: $('a.delete').undoable({ inline...

How to read javascript event programatically

Imagine you have a button like this: <input name="myButton" type="button" value="button" onclick="return test();" > where the test functions is as follows: function test(){ // do something return true; // based on some logic return boolean } Now let's say,I don't know what is set for the onclick event, and at runtime I need to ...

input field value in session variable in php

Can we use input type value in session variable without any form submitting like there is an input field now i want to save above input field value in a $_session['anyname']; when there is no form in page. ...

Jquery Unable to Hover append html

Hi there, I am appending HTML into the DOM via jquery.append - my script is as follows (please excuse the crappy code) myDiv = $("<div class='bottomright' title="+msgID+">"+msgTitle+msgContent+ "</div>").appendTo(document.body).fadeOut(0).slideDown('fast'); shown.push(msgID); is there a different way to address either the hover or th...

Jquery.change firing on page load.

<label for="AddList" class="locType">Select a location</label> <select id="AddList"> <option value="New">New Address...</option> </select> The Js. $(document).ready(function() { //Location Code $("#AddList").change(function() { var str = ""; $("#AddList option:selected").each(function() { str +...

validating onselectstart with javascript in w3c

Hi folks, I'm really very new to javascript, and trying to validate a page to xhtml transitional. I use onselectstart="return false" So I understand that I am wanting to create a javascript function that will insert that as an id. I even found this http://www.webmasterworld.com/javascript/3054096.htm and he figured out how to do it....

Modifying the contents of a page based on a "select" element

I currently have a page that allows a user to enter different types of database entries via a select("questions" for a survey), i.e. Multiple Choice, Text, Drop-down, etc. Each one atleast contains a textarea and 2 input type="text"s. Right now this is done by having 4 divs in the HTML, 3 of which are hidden via CSS ("display:none"). Th...

synchronized animations in YUI3?

Is it possible in yui3 to synchronize multiple animations so they progress together? Something similar to what is mentioned in the jquery 1.4 roadmap and demonstrated in this example http://ejohn.org/files/sync. ...

dynamic image resizing

i want to change img size to 200x150 using tag. please help. ...

disabling a javascript script when loaded on a smart phone

I am using the following HTML fragment to load a different stylesheet for smartphones: media="only screen and (min-device-width: 4801x)" media="only screen and (max-device-width: 480px)" I would like to disable a certain javascript script for smartphone users as well. Is that possible? I don't think i can do: <script media="only scre...

Simplest Facebook JavaScript streamPublish example?

This program should prompt the user to update their stream; instead it does nothing but print "splendid!" on the console. What am I missing here? The documentation seems to suggest that this is all it takes. (I've hidden my API key with Xs; normally I'd use a real key.) <html><head></head> <body> <script src="http://static.ak.connect...

submitting dynamically created form with javascript

Hello all, I'm attempting to submit a form I've created out of an html string, like this: var upload_form = "`<form action=\"uploadSong.php\" method=\"POST\" class=\"upload_form\" enctype = \"multipart/form-data\" target=\"upload_form\">`"; upload_form += "<input type=\"hidden\" name=\"showId\" value=\"" + showId ...

JavaScript alert with 3 buttons

I have a JavaScript alert button that appears on the website when a user is going to proceed to a signup page. It looks something like this Would you like to proceed to the signup page? < OK > < Cancel > Would it be possible to add a third button to the alert so that it looks like Would you like to proceed to the signup page? < Mor...

Modal audio player that continues to stream without interuption when a user browses to another page (of same site)

I'm looking for a media player (audio) that I can embed in my website (a rails app) to allow streaming audio which doesn't stop when the user goes to another page of my website. Ideally it would be modal. I've tried using the YUI Media Player but the audio reloads when users move away from the homepage and most users don't think to pla...

json selecting an item named "item"

I am trying to process a json version of a rss feed but I need to access an array labeled "data.channel.item". I suspect because this name seems to conflict with the reserved word item in javascript, the script doesn't work with only this particular json file. It does work in other cases. Is there a way to use "item" but escape it someh...

Firefox - is there an API to disable/enable an extension?

Is there an API call allowing one to enable/disable a FireFox add-on (to be more specific an extension)? ...

Firefox - how do I list installed extensions and identify them in a list?

Two related questions: Is there an API to produce a list of all the installed extensions in Firefox? If so, how would I uniquely identify an extension? What I need is to have an ID that persists through different versions of an extension and ideally through a renaming (so name may not be the best option). Is it GUID? Thanks! ...

Building a geo focused app: what should I know ?

I am looking forward to build an application that relies heavily on geographic data. The application will use HTML5's ability to get GPS data and will do computations such as finding the nearest street, finding the shortest path between 2 points, etc. I was thinking of using a platform such as Google Maps, so it will most likely be writ...

onClick event does not work with xbl:inherits

I'm developing a Firefox add-on and having a problem: onClick event does not work with xbl:inherits. Other attributes like value and src work well Here is my code Binding: <binding id="CF-review"> <content> <xul:vbox> <xul:label class="CF-review-url" xbl:inherits="onclick">[more]</xul:label> </xul:vbox>...