javascript

Robust Javascript parser in Java

Dear All: I am looking for a robust Javascript parser written in Java - by which I mean a Javascript parser that is able to handle most real world Javascript. I am only interested in parsing Javascript, not in executing it. I have found Rhino: http://groups.google.com/group/mozilla.dev.tech.js-engine.rhino/browse_thread/thread/1eff23a...

Inject Javascript into iFrame generated by TinyMCE/YUI?

I'm trying to insert/load javascript (e.g. prototype/jquery) into the iFrame generated by TinyMCE (tinymce.moxiecode.com) or YUI's text editor (http://developer.yahoo.com/yui/editor/) so as to better manipulate the objects/images/DIVs inside it. The iFrame generated by TinyMCE is basically a text editor. I want to be able to include div...

is the jQuery function "change()" working in IE ?

is the jQuery function "change()" working in IE ? I usually use it to detect changes in forms (select/unselect check boxes), and submit them automatically without having to click on submit button (which is hided). i.e. $("#views-exposed-form-Portfolio-page-1").change(function(){ $("#views-exposed-form-Portfolio-page-1").submit...

setTimeout doesn't work with window.location?

i try to rich flash like effect when changing window location, but there is a small problem, i can't solve. look at the script please $(document).ready(function(){ $('a.flash').click(function(e) { e.preventDefault(); $('body').fadeOut(1500); setTimeout("", 1500); ...

jQuery code not executing when DOM is ready

I have written a simple jQuery script that changes the hash tag of a link. I do this because I am using IntenseDebate comments in Wordpress but the comment link still links replaced id of the old comments. I'm using jQuery so that if javascript is enabled, the user can click on the comments link and it will take them to the IntenseDebate...

Websites that archive cross-browser, cross-platform css/js bugs?

I'm about to develop my own browser inconsistency/bug compendium site but I'm wondering if I really need to - can we get a wiki of sites that do this already? I'm aware of a lot of them but I hope I'm not missing out on some major ones. I wanted mine to be more intuitive and social-like for most people, powered by tags and screenshots a...

Observing 'click' event on <a> tag generated by scriptaculous Builder

I'm using scriptaculous Builder to generate some DOM elements dynamically, and one of them is a link tag. I wasn't sure how to generate this with the click callback inline along with the rest of the Builder code, so I'm generating the link tag ahead of time and then inserting it with the rest of the Builder phase. The problem is that t...

Aptana Javascript templates

Hi, I'd like to set my Eclipse to use javascript templates with Aptana Studio. I've set a new template here: window/preferences/aptana/editors/javascript/templates. The template's description: name: ccc, context: javascript, description: own comment, pattern: // -- I open .js files with aptana JS editor and the perspective is Aptana ...

How to handle empty return from getJSON

Alright so I have a php script which gets results from a DB, and to get those results I'm using a jQuery script to pull the results via getJSON. It works perfectly but now I want to do something if the php script returns no results (empty). I tried: $.getJSON('path/to/script'), {parameter:parameter}, function(data){ if (data) { aler...

how do I call a javacript function every 60 seconds?

So I'm trying to work on a Canvas demo, and I want this square to move from one side to the other, but I can't figure out how to call javascript in a way that repeats every 60 seconds. Here's what I got so far: <!DOCTYPE html> <html lang="en"> <head> <title>Canvas test</title> <meta charset="utf-8" /> <link ...

Binding Events rather than using onclick

Hello all, I have been told its better to bind events to elements rather than having onclicks with functions everywhere. I agree with this as it devolves more from the HTML which means cleaner and easier to debug code. But I am having trouble doing this! I loop through some data with PHP (see below) and I currently use onclick to call...

ASP.NET how to use __doPostBack from Custom JavaScript with Master/Content Pages

In a simple aspx page I can have a custom JavaScript function postback as described in http://www.xefteri.com/articles/show.cfm?id=18 The simple page uses a linkbutton: <asp:LinkButton id="CreateFile" runat="server" onclick="CreateFile_Click" /> with code behind that has the VB subroutine: Sub CreateFile_Click(ByVal sender As System....

Drag and drop to reposition content inside a TinyMCE editor

I'm using TinyMCE and I'd like to make it easy to click and drag styled elements inside the content area. This works very well for (unstyled) images, as the browser seems to handle them natively, so you can drag an image and drop it on another line in the content area and the image gets moved there. What I'd like to do is have a div wi...

send name="" in jquery javascript?

Hello So i have this: yes: <input type="radio" value="Y" id="SCvoteY" name="vote"></input> no: <input type="radio" id="SCvoteN" value="N" name="vote"> </input> How do i write that it should transfer name="vote" data ? #vote doesnt work, .vote either (guess it cause thats for class and ID) but what about name then? function DoSCInser...

I am trying to get a simple jqplot example going but it will not display, why not?

Here is the entire contents of the file: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>jqPlot Examples</title> <!--[if IE]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]--> <script language="javascript" type="text/javascript" src="../...

Controlling a browser from Python

I am looking for a way to control a browser from Python, i.e. fill out form fields and submit them, possibly call JS functions. I've looked around a bit, but as far as I could see PyWebKitGtk only lets you show the browser as a GUI element, not interface with it. Is there a way to do this easily? I wrote my program logic in Python, an...

Can Content script set value of a text box within HTML frame? using Google Chrome extensions..

Hi all, I was working on a very simple extension, where on clicking extension icon, a webpage is opened in a new tab, the webpage has HTML frames, within which lies a textbox. I want to set a value for the same. The webpage which opens has: <HTML> <FRAMESET rows="15%, *" border="0"> <FRAME src="./files/abc.htm" id="abc_frame" name="ab...

Background position image overlay (Works in IE, not in Mozilla/Chrome/Safari)

Hi all, I am having an issue positioning a background image using the following jquery background position command in Firefox, Google Chrome, and Safari. The code works correctly in IE 8. $('#element').css({ backgroundPosition: 'xpx ypx' }); The desired effect is a continuous stream of fluid from the right side of the screen to the ...

Javascript onsubmit clearcontent not working.

<textarea onfocus=" javascript:clearContents(this); this.cleared=true;" rows="5" cols="40" id="comment" name="comment" <?php if($vis["username"] == $pusername) { echo "DISABLED"; } ?>>...</textarea> <input onsubmit="if (!this.comment.cleared) clearContents(this.comment); return true;" type="submit" name="Submit" value="Stem!"/> functio...

Do you know of a JavaScript widget for Solar Hijridates?

Do you know of a JavaScript widget for Solar Hijri (Jalali) dates? Users will likely enter dates as Solar Hijri and I need to convert. ...