javascript

What would be a good Delphi lexer/parser for Javascript language file?

Background I want to be able to parse Javascript source in a Delphi Application. I need to be able to identify variables and functions within the source for the purpose of making changes to the code through later code. I understand that I probably need to use a lexer for this purpose but have not had much luck using the lexer which I fo...

Close a browser window of an ASP.NET and AJAX application

What is the best way to close a browser window of an AJAX ASP.NET application after the server-side has been executed. I found this solution, but it seems a little complex for what I want to accomplish. Or is this the best way to accomplish my task. UPDATE: I have to close the window after the button is pressed UPDATE 1: I tried the ...

Detect which form input has focus using JavaScript or jQuery

Hi, How do you detect which form input has focus using JavaScript or jQuery? From within a function I want to be able to determine which form input has focus. I'd like to be able to do this in straight JavaScript and/or jQuery. Thanks, Everett ...

Packing Javascripts - Is it worth it?

If a packed Javascript saves 20kb off the download size, but takes a perfomance hit to unpack, then are there any benefits, besides obfuscating the code? I've made this a community wiki because it may be open to some discussion. ...

Javascript - Trouble with preloading images

I have an object in place to run my image slideshow that is meant to: Build a list of images from a hidden unordered list with links to the images For debugging purposes, I've attached the next image method event to clicking on the gallery (the image) If the image hasn't been downloaded to cache, then download the image first. Cross fa...

jQuery Event To Detect When Element Position Changes

I would like to know if there is a jQuery event that I can use to determine when a particular DIV's "Top" property has changed. For instance, I have invisible content above a DIV. When that content becomes visible the DIV is shifted down. I would like to capture that event and then use the offset() function to get the X/Y coordinates....

How do I escape an ampersand in a javascript string so that the page will validate strict?

I am trying to pass a dataString to to an ajax call using JQuery. In the call, I construct the get parameters and then send them to the php page on the receiving end. The trouble is that the data string has ampersands in them and the HTML strict validator is chocking on it. Here is the code: $(document).ready(function(){ $("input#em...

Adding Controls using Javascript and get Their Value from codebehind

Hi, I wanna add server controls by using javascript. The main purpose of why I want is to add controls without any postback and get them in code-behind. ...

Refer to a html List item object properly in javascript for Event Registration

I would like to know how I can refer to a list item object if I had for example the following html list <div id="subdiv_2"> <div id="subdiv_3"> <ul> <li><a href="">Item1</a></li> <li><a href="">Item2</a></li> <li><a href="">Item3</a></li> </ul> </div> </div> How is it possible to register an onclick ...

method: => :delete not working and :confirm option ignored

After returning to an old Rails project I found none of the destroy/delete links worked and clicking cancel on the confirmation popup would still submit the link. Example of my code is: <%= link_to 'Delete', admin_user_path(@user), :confirm => 'Are you sure?', :method => :delete %> ...

Javascript button click + reveal

I have a big red button and I'm trying to use javascript to perform the following: - OnMouseDown change image so the button looks depressed OnMouseUp return to the initial image AND reveal a hidden div I can get the onMouse Down and onMouseUp image changes part to work. I can also get the hidden div to reveal by using OnClick The p...

how to write a recursive method in JavaScript using window.setTimeout()?

I'm writing a JavaSCript class that has a method that recursively calls itself. Scheduler.prototype.updateTimer = function () { document.write( this._currentTime ); this._currentTime -= 1000; // recursively calls itself this._updateUITimerHandler = window.setTimeout( arguments.callee , 1000 ); } Property description: ...

What is the best way to emulate "classes" in Javascript? (with or without a framework)

Update: I've wikified this so it can become a more useful resource. What is the best way to emulate classes (and namespaces) in Javascript? I need to create a Javascript library and have limited experience with the language. I always thought that it had native support for classes, but it is less related to Java than I had assumed. I...

JavaScript function not responsive

Hello, I have the following code, which is the core part of my small AJAX application. I am not getting any errors, it is just that nothing happens. I am guessing there is a more efficient way to do what I am trying to do. Here is the code: var xmlHttp var layername function update(layer, part, pk, query) { if (part=="1") { $url...

php and mysql searching and passing variables problem

Hello, I have the following code: http://www.nomorepasting.com/getpaste.php?pasteid=22615 Which is called by the javascript mentioned in this question: My problem is that I do not seem to be able to pass $query, as in nothing seemingly happens when I call this file by itself. I am unsure what the best way to control the flow of info...

MySQL and PHP unicode problems

Hello, I have the following UTF-8 file exported from a microsoft access file http://www.yousendit.com/download/TTZtT214SU84Q1FLSkE9PQ I have ensured my mysql database is utf8 with the status; command for both client and server. I insert the above file into my database with the following command: LOAD DATA LOCAL INFILE 'tblAuction1.tx...

How to find out the TabSelection

Dear All, I have using the code for developing tabs $(document).ready(function() { $('#container-1').tabs(); } .... <div id="container-1"> <ul> <li><a href="#fragment-1"><span>Home</span></a></li> <li><a href="#fragment-2"><span>Contact</span></a></li> </ul> </div> ...

Form with Hidden Tags to cybercart- bring it up on the same page?

Hi, what I want to do is basically this: On ONE page, my customers can click a VIEW CART link and the contents of their cart shows below on that same page. here is my basic link form: <FORM METHOD=post ACTION="http://www.123websiteservices.com/cgi-bin/cybercart.pl"&gt; <INPUT TYPE=hidden NAME=merchant VALUE="jessicas"/> <INPUT TYPE=h...

JavaScript/Greasemonkey: Avoiding FireFox Security Warning when Submitting a Form from a Secure Page

Hi, I'm writing a Greasemonkey script to connect two company-internal webpages. One is SSL, and the other is insecure and can only be accessed via a POST request. If I create a hidden form on the secure page and submit it via an onclick() in an <a>, it works fine, but FF gives a warning: Although this page is encrypted, the infor...

Is there a way to open a link in a frame and suppress all popups on the external site?

I'm wondering if it's possible to open a link to another site, in a frame (or by some other means), and suppress the 1-2 popups that load on the external site. ...