javascript

What is the best approach to store xml temporarily on the client side?

My application has a lot of decision to make before finally saving my data to the database. I am using JQuery to do this. I have succeeded in creating a moderately long xml string, due to the fact that the user will enter data that will each need to be verified. I have made this decision base of the number of trips i expect my applicati...

Opera Unite Javascript oddity

I am having a weird time with an Opera Unite web app I'm getting my feet wet with. I'm using the getItem() function to return data that's posted. Now that's supposed to return null if there's no such value, which works, my first conditional works when there's no POST. It even works when I post a value. What's messing up is when I pos...

how to set visible true and false for drop down list box using javascript in asp.net

<asp:DropDownList ID="ddloption" runat="server" Visible="false"> <asp:ListItem Text="Active" Value="Active"></asp:ListItem> <asp:ListItem Text="D-Active" Value="D-Active"></asp:ListItem> </asp:DropDownList> function boxchange(dd) { document.getElementById("<%= ddloption.ClientID%>").visibility = "visible"; } ddloption is null, w...

parseInt, parseFloat, Number... i dont know

Hi Does someone know why this just wont work!! i have tried alsorts. function loadJcrop(widthN, heightN){ var run = true; if( run === true ) { alert( parseInt(Number(widthN) / Number(heightN)) ); jQuery(function(widthN, heightN) { jQuery('#cropbox').Jcrop({ onChange: showCoords, onSelect: showCoords, aspe...

javascript: function call to itself

hi all, I suppose the following code: jQuery("#mybutton").click(function(){ //do something }); How could I recall to this function "anonymous"?, I can not put a name to this function: var xfun = function(){ //do something } jQuery("#mybutton").click(xfun); I can do something like this: var working = false; jQuery("#my...

Converting Date and Time To Unix Timestamp

I'm displaying the date and time like this 24-Nov-2009 17:57:35 I'd like to convert it to a unix timestamp so I can manipulate it easily. I'd need to use regex to match each part of the string then work out the unix timestamp from that. I'm awful with regex but I came up with this. Please suggest improvements ^.^ /((\d){2}+)-((Ja...

JQuery Overlay does not auto close on Flowplayer video end

Hey guys, I am using both Flowplayer and Jquery Tools Overlay. I have my overlay to display when they click a link. The overlay displays correctly and the video auto-starts as it should but when it ends, I was trying to call the overlay's close function to close it out. Here is my div for the overlay. <script> var pla...

Javascript file dependencies - Selective load resource files & prevent duplicates

This might be more of a philosophical debate, but here is what I have: Two controls which share a Javascript resource library to call a webservice. They are ususally used in conjunction with each other, but not always. The javacsript file they both reference is not easily separated. The javascript file should not be added to every pa...

how to implement cascaded dialogs in DOJO Toolkit

I was looking for cascaded (multi-level) dialogs in DOJO Toolkit. I understand that a proper implementation of this will be available in DOJO 1.4. (http://stackoverflow.com/questions/809350/dojo-dialog-nesting) I was wondering if a basic functionality of it (for managing the zIndexes) could be done easily by sub-classing the existing d...

Closure/scope JavaScript/jQuery

Hello all, I'm trying to group some exisiting top-level functions inside a closure (to avoid polluting the global namespace) but I'm not quite getting it to work. First, all the JS works outside my anonymous function, but once I put it in the anonymous function I get an error of "crossfade is not defined". Does anyone see anything comp...

What are the individual tests SunSpider JavaScript benchmark runs?

Can someone explain to me what each SunSpider subtest actually checks and give a real-life equivalent of their importance and use? Which outcomes (ie times) are considered acceptable for a modern system? The only information I have found so far was generic for each subsection, at Coding Horror. 3d Pure JavaScript computations of ...

Use Javascript E4X to selectively rename XML tags

I am using javascript to manipulate XML in a non-browser context (no DOM), and am looking for an E4X expression to rename a list of tags. For any given tag, I don't necessarily know ahead of time what it is called, and I only want to rename it if it contains a given substring. As I very contrived example, I may have: someXML = <Favouri...

How much access should an OS give to web-based scripting?

I've been thinking about the access web-based applications have to an OS. I'm curious: What is the best way of determining this as it currently stands? Is the trend leaning toward more, or less access? What functionalities should be open/closed? A simple example would be.. say your g-mail alerted you in the task-bar when an incomi...

Pure Javascript app + Amazon S3 ?

I'm looking to confirm or refute the following: For what I have read so far it is not possible to write a web application with only javascript -- no server side logic -- served from Amazon S3 that also store data only to S3 if you need to have multiple clients with private data per client. The issue I see is the Authorization header re...

Does php load BEFORE the 'html body' ?

Difficult to explain this Question, but im currently passing variables in a php page to some html hidden inputs. Im fetching those values from the hidden inputs with a javascript function. This function gets called like this: <body onload="function();"> It works on my system now, but is there any chance that the value passed from ph...

Closing Firefox browser by javascript

i'm using simple close browser javascript statement winodw.close(); but it doesn't work with any browser except IE. any help to close browser firefox or opera or chrome. thanks ...

adding fade to jquery image replacement

Hello- Im creating a nav that uses jquery to replace the image on rollover. Here is the code I am using: http://peps.ca/blog/easy-image-rollover-script-with-jquery/ basically, you add a suffix (_o) to the filename and when you rollover the src, jquery replaces it with the (_o).png. I want to add fade so when there is a rollover, the ...

changing value of xml attribute queried by xpath query ?

I use javascript xpath queries (document.evaluate(...)) to read and modify parts of xml/svg/html documents. Setting the nodeValue of queried element and text nodes is no problem. but when setting attribute values, it is indeed set, but not reflected on the attribute DOM Node. It looks like xpath queries for attribute nodes return (name...

How to use JSON.parse reviver parameter to parse date string

Hello all! My JSON string contains a date field that returns such a value "2009-04-04T22:55:16.0000000-04:00" I am particularly interested in parsing only the date compartment not the time. I tried using reviver function but interestingly the reviver function is never invoked! (tried on Firefox) Here is my code to accomplish that: va...

Some cookies not sent to server

I am attempting to set a cookie on a particular page to be read on another page. I wish to know why the other page is not being sent the cookie. Examining what is going on shows that the cookie is being set, but is not being sent to the server. My understanding was that if the path of a cookie is not set, the cookie will be sent to an...