javascript

Conditional If statements within jQueryUI's options?

I have a JavaScript function that I'm passing an argument to, that opens a jQueryUI Dialog. I want the dialog to have either one or two buttons, based on the value of the argument. How should I do this? So far I've tried: function foo(hasFile) { $('#dialog').dialog({ buttons: { Close: function() { $(this).dialog...

Is it possible to have to call the Google AJAX Feed API twice on the same page?

I was thinking of using a slider panel to display two different feed-sections. For example pulling in Tech in one div, and Sports in another.. Thanks! ...

JavaScript: how to create a JS event that requires 2 seperate JS files to be loaded first while downloading them asynchronously?

I want to perform asynchronous JavaScript downloads of two files that have dependencies attached to them. // asynch download of jquery and gmaps function addScript(url) { var script = document.createElement('script'); script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } addScript('http://google....

Validate Form with PHP AND Javascriipt?

Is it possible to validate a form with PHP AND Javascript? I am currently able to do both using my existing form but only on an individual basis. My overall goal is this: Validate form using javascript client side and present any errors to the user immediately If javascript validation passes, a flag is created and then the PHP script...

JS: variable inheritance in anonymous functions - scope

hey guys, someone from doctype sent me here. long story short: var o="before"; x = function() //this needs to be an anonymous function { alert(o); //the variable "o" is from the parent scope }; o="after"; //this chages "o" in the anonymous function x(); //this results in in alert("after"); //which is not the way i want/need it in r...

How to translate .PDF files using google APIs?

How to translate .PDF files using google APIs? (translate from language the pdf's are to for example russian (new pdf file orplain text or html).) (code example needed) ...

Renumbering numerically ordered div ID's when adding one in the middle with Javascript

I'm developing an application with javascript. What I need is to have divs with id's (1,2,3...) and be able to insert a div between, for example, 2 and 3, with jquery, and then have that be the new three, and three becomes four, four becomes five, etc. I've got the div insertion working, I just need to know how to reorder the divs. Any i...

JavaScript OnClick Handler Not Invoking

I'm calling a javascript function in an inline onclick like so: <a href="#" onclick="removeAttribute('foo', 'bar');">Some Link</a> When I click on the link, though, nothing happens. I have other links (to other functions) tied to onclicks that work fine elsewhere on the same page. All links to this "removeAttribute" function fail. Th...

Multiple Controls on a Page with Multiple Instances of Javascript

I have created a Web Control in ASP for use in integrating with Telligent CommunityServer. The control is written in ASP with some 10 lines of C# backend for controlling visibility of the UI elements based on permissions, but I'd say 90% of the functionality is straight-up Javascript. The control works beautifully, until you drop two i...

Phone Number Recognition in Javascript

Hi Guys, Is there a javascript library the can recognize phone numbers in a web page? Just like what skype did on their firefox plugin. Or do you know a way on how to do it? Websites or any tutorial that do the same would be very helpful. Your reply is greatly appreciated. Best, ...

How to count new lines in Internet Explorer?

Hey, all. I'm doing my own syntax highlighter for Javascript and CSS, and I've run into an issue with Internet Explorer (big surprise). I grab all the contents of a code.block tag (example below) using innerHTML, and .split("\n") that result to get each line by itself. This works wonderfully except in IE. I have tried using innerText...

How to get an object of the window which is opened by clicking the link?

Hi I've got a link on the web page that causes new browser window (tab) to be opened when it's clicked, like this: <a id="lnkNewWindow" target="_blank" href="http://google.com"&gt;Open window</a> I want to be able to track the window that will be created after this link is clicked. I'd like to perform some actions after the new wind...

In what order does DOJO handles ajax requests?

Hi, Using a form in a dialog box I am using Dojo in jsp to save the form in my database. After that request is completed using dojo.xhrPost() I am sending in another request to update a dropdown box that should include the added form object that was just saved, but for some reason the request to update the dropdown is executed before s...

building Mozilla Spider Monkey on Ubuntu

Hi. I'm trying to build spider monkey on ubuntu 10.04 (lucid). However, when I run autoconf2.13 on the js/src directory, it tells me there is no configure.in file. I can't just do the usual ./configure > make > sudo make install , either. What's up with it? ...

Slideout page using javascript?

How do you create your own slideout page using javascript? see http://support.tweetboard.com/home/#installation click on "tweets" ...

Javascript - How to index html code into variables

The webpage has the following source (only copied the important part): <h1>Relatórios</h1> <div id="textmenu"> <a href="berichte.php" class="selected ">Tudo</a> | <a href="berichte.php?t=2">Comércio</a> | <a href="berichte.php?t=1">Reforços</a> | <a href="berichte.php?t=3">Ataques</a> | <a href="berichte.php?t=4">Outros</a> </di...

javascript string exec strange behavior

have funciton in my object which is called regularly. parse : function(html) { var regexp = /...some pattern.../ var match = regexp.exec(html); while (match != null) { ... match = regexp.exec(html); } ... var r = /...pattern.../g; var m = r.exec(html); } with unchanged html the m returns...

Can I void all JavaScript calls to $

I need some scripts inside an existing site's scripts.js. This site has been online for ages, and I can not touch the scripts file. I am including it standardly in another page. There are numerous jQuery calls in the scripts file. The place I include it does not have jQuery. I want to void all $() type things. I tried this... $ = fun...

How to update child iFrame's entire html (header+body) inside jQuery's post

I have a chat webpage for Firefox that is structured like this ..... Outer HTML -----|......Frameset Frame ------------|...... header: contains jQuery post has returned data: rdata = new_iFrame_html_str, the entire html string of the iFrame that should be updated ------------|...... iFrame --------------------|...... header: contain...

Is there any tutorial on starting Adobe AIR app from browser ?

Is there any tutorial on starting (not install but application start\wake up call with parameters) Adobe AIR app from browser (on button click within flash app using JS function or what ever is needed)? Blog articles or any other materials wanted... ...