javascript

How to mix multiple javascript files into one?

To reduce http request i want to mix multiple jquery plugin's javascript filesa and main jquery file into one. What things should be considered? Do we just need to place code from all files into new file one bye one or need to do something more. ? ...

Accessing an iFrame's dom from a Firefox Extension

Hi all, I've spent a long time trying different things to get this to work but nothing does and documentation is not helping much. I'm trying to populate a form inside an iframe that I dynamically inject into a page. To inject that iframe I do: myObject.iframe = document.createElement("iframe"); myObject.iframe.setAttribute("src", dat...

Regex to match part of a string

Regex fun again... Take for example http://something.com/en/page I want to test for an exact match on /en/ including the forward slashes, otherwise it could match 'en' from other parts of the string. I'm sure this is easy, for someone other than me! EDIT: I'm using it for a string.match() in javascript ...

Javascript going through a Proxy

I am working on a project right now that requires some javascript for the proper functionality we are looking for. The problem we are running into is that the clients of this web-based app can only access the site through a proxy server (due to strict policies). This proxy server is stripping the javascript from the page and we are una...

Javascript problem with location.href.

Hello! I have a textbox and whenever the user presses a key it's checked to see if the user pressed enter. If the enter key is pressed, i want to add all the info in the textbox and transfer the user to a different url. <script language="javascript" type="text/javascript"> function checkEnter(e){ //e is event object passed from fun...

Masking &amp; for AJAX requests

This is a follow-up to a question I asked a few weeks back. The following: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html> <head> <title>Test</title> </head> <body> <a onclick="start_ajax_request('url.php&key1=val1&key2=val2&key3=val3')">Test</a> </body> </html> ...

How to add non-standard attributes in a valid way

Is there a way to have non-standard attributes like onselectstart oncontextmenu ... in a tag, and still pass validation as HTML 4.01 transitional somehow? Apart from adding the properties later on using Javascript. ...

Ajax long polling (comet) + php on lighttpd v1.4.22 multiple instances problem.

Hi, I am new to this site, so I really hope I will provide all the necessary information regarding my question. I've been trying to create a "new message arrived notification" using long polling. Currently I am initiating the polling request by window.onLoad event of each page in my site. On the server side I have an infinite loop: w...

XML ActiveXObject IE. Object doesn't support this action

I am trying to work with xml and javascript. In firefox it works great using XMLHttpRequest but in IE (6-8) I am getting the error: Object doesn't support this action I am using the following function: function createRequestObject(){ var request; try { request = new XMLHttpRequest(); } catch (trymicrosoft) { ...

w3schools AJAX example

What would I need to do to get this example running on my machine? http://www.w3schools.com/ajax/tryit.asp?filename=tryajax%5Fhttprequest%5Fjs I'm looking to access the XML file hosted on w3schools (and not move it to my machine), but run the HTML and Javascript code on my machine. I tried changing the third to last line from: <button...

Execute javascript after external javascript document has loaded

Hi guys, I want to include a remote js file and then invoke a function once that has finished executing. I thought I could do something like this: var sc = document.createElement('script'); sc.setAttribute('type', 'text/javascript'); sc.setAttribute('src', src); sc.innerHTML = "alert('testing');" parentNode.appendChild(sc); Turns out...

What should I learn?

I work for a small web design company, and learned everything I know on the job (my degree is in chemistry!). The other coder here taught me a fair bit of php, and I've had to pick up MySQL and a bit of javascript. I've also increased my knowledge of CSS. (HTML itself I already knew, really, along with a little CSS.) Now, I am the sort ...

jQuery datepicker to prevent past date

How do I disable past dates on jQuery datepicker? I looked for options but don't seem to find anything that indicates the ability to disable past dates. UPDATE: Thanks yall for the quick response. I tried that with no luck. Days were still not grayed out as I expected and still accept the selected past date. I tried this: $('#datepi...

How different are the semantics between Python and JavaScript?

Both these languages seem extremely similar to me. Although Python supports actual classes instead of being prototype-based, in Python classes are not all that different from functions that generate objects containing values and functions, just as you'd do in JavaScript. On the other hand, JavaScript only supports floating-point number...

EBNF for ECMAScript?

I'm trying to find a good EBNF description of ECMAScript, but so far I've not found anything complete. Any ideas? ...

image dump from print screen

How would you dump an image captured using the print sreen key into a div tag? ...

how to detect .flv movie file URL ?

when theres a flash video, how can i detect the current flv URL ? viewing the source doesn't reveal it. However, I wonder if theres any approach to figuring out the .flv URL (Where it's hosted at the moment it's being streamed). I see that there are firefox add on's that does this. I wonder how these work, and whether it can be implemen...

Including javascript in a drupal page or form

Is there a drupal function or convention for including JavaScript onto a page or form? My current solution is to hard code the script tag as part of the output of my form's theming function, but it seems like there should be a better way, since JavaScript should generally be the last thing loaded on the page. ...

jQuery's live and livequery not working for me when the form is loaded through ajax.

I asked a similar question earlier http://stackoverflow.com/questions/1610752/how-can-i-have-jquery-attach-behavior-to-an-element-after-inserting-it, but still have not found an answer. To keep things clear I am asking a new question with a different example. Here is my code that doesn't work. $(document).ready(function() { $('form...

hack proof html coding with ajax

I have many lists e.g. a todo list, a shopping list etc. on my web page. I am using AJAX to add or delete the items. For example, for a todo list my HTML is like: <tr id="todo_userttypea_23"> <td>name</td><td>Delete</td></tr> Note if the users press delete then I am deleting that row. I get the id of the row and then break it to find...