javascript

JavaScript: merging files without problems?

I have three javascript files that I want to merge into a single file. Is it possible to just copy paste all of the code into one file or will there be namespace conflicts and other problems? EDIT: I'm worried that each file acts like a namespace encapsulating each file's code, and that this encapsulating will cease to existing if I mer...

sending hierarchical data from javascript over flat POST request

I have a page on which user can dinamically create some identical groups of inputs, fill it and send to server. <input type="text" name="firstName"/> <input type="text" name="lastName"/> What is a preferable way of sending this data to server? Maybe there are some simple ways of emulating hierarhical data over POST request, avoidi...

What's the best way for the server to send messages to a web client?

Links to articles would also be appreciated--I don't know the terminology to search for. I'm looking to learn how a web application can allow for server-to-client communications. I know the web was not designed for this and that it has been something of a hurdle, and am just wondering what the state of this is, and what the best practic...

How do JavaScript tidbits insert remote widgets onto a page?

Let's say I have a web service that allows users to insert a piece of JavaScript onto their page which, when loaded, will grab a widget from my server and insert it into their page. How might I go about doing that, and what techniques should I use? document.write? ...

Static variables in an anonymous function

Hi, I'm trying to mimic static variables on a JavaScript function, with the following purpose: $.fn.collapsible = function() { triggers = $(this).children('.collapse-trigger'); jQuery.each(triggers, function() { $(this).click(function() { collapse = $(this).parent().find('.collapse'); }) }) } How do I save the "co...

Javascript callback function issue.

Background I'm writing an asynchronous comment system for my website, after reading plenty of tutorials on how to accomplish this I started building one from scratch. The comments are pulled using a JSON request and displayed using Javascript (jQuery). When the user adds a new comment it goes through the hoops and finally is sent via ...

Script block in XSL not being rendered

I can't get a <script></script> block in my XSL template to be rendered. It is simply being ignored by the parser, the block itself and anything inside it. By the way, I am using the DotNetNuke report module. Any ideas on how to solve this? Thanks. ...

JavaScript query string

Is there any JavaScript library that makes a dictionary out of the query string, ASP.NET style? Something that would be used like: var query = window.location.querystring["query"]? Is a "query string" called something else outside the .NET realm? Why isn't location.search broken into a key/value collection already? EDIT: I have writ...

Showing a Splash Screen during script execution

Hi, I want to know how to show a splash screen (like a gif or jpeg file) on the user screen during my script execution. Thank you for your help. ...

Html scroll: how to avoid it to "cut" my inner elements

Hi, this question is for an autocomplete drop down list I have to do that will fire while you're writing in an html textbox. It basically consists of a div containing the suggestion elements, each of them being a div as well. I got to the point where it's begining to work properly but now I added a vertical scroll to the containing di...

How to return a JavaScript 'native' array from a C# method?

I'm trying to call a C# method from JavaScript by using ActiveXObject: var myobj = new ActiveXObject('myobject'); var arr = myobj.GetArray(); Eventually, arr will contain a SAFEARRAY object, but not JScript array. Is there any way to return native JavaScript object from a C# method? ...

Multiplayer game to demo Wi-fi

Hi guys I need an idea. So in Germany we have built up a huge Wi-fi system and usually you have to login to the system to surf the web. As a gimik we want to add a multiplayer game so without having to pay for usual internet they can play a webbased multiplayer game. What multiplayer games do you know. It just has to be 2 player really....

Dojo resize and delete element on animation complete

With a div like this: <div id="im1" class="information_message error">Error message here <a href="javascript:hide('im1')">Hide</a></div> And the following dojo/javascript code: function hide(id){ id.innerHTML = ''; dojo.animateProperty({ node: id, duration: 500, properties: { height: {end: 0} }, ...

Detect exact OS version from browser

Hello, I was ondering if there is a way I can detect the exact OS version from my browser using PHP/JS/ASP? I know I can detect the type of OS (Windows XP,Windows Vista,OS X,etc) but I need to detect the exact version: Vista Business, Vista Ultimate, Windows XP Home, Windows XP Pro, etc... Thanks, Roy. ...

Problem with SWFObject in IE

I'm having a problem with SWFObject in IE. The swf-file shows, but everything below the swf doesn't. Here's the URL: http://timkjaerlange.com/wip/co2penhagen/ Any ideas to what could be wrong? ...

Is the order of fields in a javascript object predicatble when looping through them?

In php, if you have the following code: $map = array( "first" => 1, "second" => 2 ); $map["third"] = 3; foreach($map as $key => $value) { // code } You know the entries will be listed in the order they have been added to the array. Now, can I assume the same rule applies to the Javascript equivalent below? map = { "first":...

Dynamic Height to an Amazon aStore

There is a similar question here: http://stackoverflow.com/questions/525992/resize-iframe-height-according-to-content-height-in-it. But it is not about Amazon aStore. When you create an Amazon aStore, you get a code like: < iframe src="http://astore.amazon.com/AMAZON_SOME_STORE_HERE-20" width="90%" height="4000" frameborder="0" ...

IIS7 javascript error on remote machine only

Hi, I have a working asp.net app with a lot of telerik controls, jQuery, dynamic data and lots of aax calls. On my dev machine everything runs fine. No errors. Deployed to the web server (iis7 on w2k8) the app runs fine when seen in IE on the server. But IE on any remote machine (tested on XP and Vista)) gives me a expected ';' javascr...

How to: Back button support "Ajax"

I have an asp.net ajax website, it full of things happen on the same page without page reload, such as sorting records, paging,... When the user go to another page in the same site and press the browser back button, how can i make the browser save the page state to return to it with the preselected options such as sorting option, page nu...

Interpreting JavaScript outside of the browser?

This is more out of curiosity that a real requirement, but I'm wondering if it's possible to treat JavaScript as (ideally) a first-class .NET citizen, or (secondarily) have some way of invoking/interpreting pure JavaScript functions (that don't require the DOM) in a desktop setting? Has anyone ever attempted implementing a CLR version o...