javascript

Ajax request in progress jQuery

Hi, Is there a way to check if there's ajax request in progress? Something like: if ( $.ajax.inProgress ){ do this; } else { do that; } ...

Javascript doesn't change document?

Take a look at this example code, which doesn't work: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <script type="text/javascript"> <!-- function moveMe() { ...

Creating sublines on Joomla menu items

In my toplevel menu items, I would like to make a subline for each item. I don't think it's possible to do by default, byt YooTheme has done it in many of their templates. The menu output look like this <div class="moduletable_menu"> <ul id="mainmenu" class="menu"> <li class="active item1" id="current"> <a href="URL_HIDDEN"...

Regex remove everything thats outside { }

Regex to remove everything outside the { } for example: before: |loader|1|2|3|4|5|6|7|8|9|{"data" : "some data" } after: {"data" : "some data" } with @Marcelo's regex this works but not if there are others {} inside the {} like here: "|loader|1|2|3|4|5|6|7|8|9| {'data': [ {'data':'some data'} ], }"...

Google Maps: marker icon and popup window

The code below opens a popup-window whenever a marker on the map is clicked. It works: <script type="text/javascript"> function popup() { newwindow = window.open('test.php','Test','width=800,height=500'); newwindow.focus(); return false; } function addMarker(lat, lng, map){ var latlng = new g...

Is it possible enumerate all the page ready event observers, using jquery / js?

Is it possible to report all the observers of the 'ready' events. I have a page where something is happening twice, and i'm trying to chase it back to the source. ...

start html page scrolled

I have an Html page with an scroll ,and I'd like when the page starts (onload) to put the focus in the 60% parox (y axis) of the page. that means to scroll automatically the 60% of the page. is this possible? thankyou ...

Pass a parameter has its onload

Hello, in my jsp I have a <body onload(...)> ... and I want to send a parameter from my action ...

Flymake quits right ahead after loading with js2-mode

When opening .js files, js2-mode and, subsequently, flymake-js is automatically loaded. But flymake unloads right ahead with the message Toggling flymake-mode off; better pass an explicit argument. However, when enabling it manually, using M-x flymake-mode, it keeps activated. Has anybody encountered similar behavior and has fixed...

Is it easy to develop a simple Firefox plugin (JS injection)

Hello everyone! So I was just wondering if it was easy to develop a very simple Firefox plugin where you could click a button, and it would execute some Javascript code! Please note that I have never developed any kind of plugin for firefox, I just want to know if that is an easy task to do (like less than an hour) I would also like to...

How to add a toolbar (like google translate) to a webpage opened through a link for saving/processing using html/javascript and php?

Hello, lets say I have bunch of hyperlinks. When link is clicked, I'd like an opened page (in a separate window) to have a google-translator style toolbox that I could use to save the page to a localdisk if I liked it, adding a few tags to the database using php. I understand how to save a file using php, but could You help me with ideas...

inspect native code

is there any way by which I can explore native code in Javascript. I want to see what Function() class has in it. ...

Changing the background of other link on hover of the First link.

I have the following mark up. <ul> <li><a><span>link-1</span></a></li> <li><a><span>link-2</span></a></li> <li><a><span>link-3</span></a></li> </ul> When user hover on the first 'a' then the next a tag in LI , we remove the backgorund-image. I hope you are clear what I want to do with this. ...

Why this button doesn't cause triple postback?

We have developed a page with a asp.net and debugging it accidentally we have discovered on our page button with the next code on onclik attribute onclick="__doPostBack('ctl00$FormPlace$m_userTaskMarkAsUnreadButton',''); __doPostBack('ctl00$FormPlace$m_userTaskMarkAsUnreadButton','');WebForm_DoPostBackWithOptions(new WebForm_PostBackOpt...

tab control item contain individual pages

My tab control items contain three different pages.Clicking on tabitem ,they are visible,but when want to perform javascript event on page item then problem arise.javascript well works for only first tab control item,rest of them are not work.Show me the bellow error. Microsoft JScript runtime error: 'this.GetStateInput().value' is null...

Is this Javascript object literal key restriction strictly due to parsing?

Please refer to the code below, when I "comment in" either of the commented out lines, it causes the error (in IE) of "':' expected". So then is my conclusion correct, that this inability to provide a reference to an object value, as an object key in a string literal; is this strictly an interpreter/parsing issue? Is this a candidate f...

Javascript plugins design pattern like jQuery

Could someone write down a very simple basic example in javascript to conceptualize (and hopefully make me understand) how the jQuery plugin design pattern is done and how it works? I'm not interested in how creating plugin for jQuery (so no jQuery code here at all). I'm interested in a simple explanation (maybe with a bit of Javascript...

jQuery.html() removes scripts and styles

Is there a way to use jQuery.html() and not loose the scripts and styles? or any other non-jQuery way? I'm trying to output the full HTML of the page the user is on. Is this even possible? ...

Check server response in javascript.

I want to check server response in javascript. For example I have a server A which will host the script. On excuting the script it will check if the server B is responding or not. If yest continue other wise redirect to server C. Is this possible with Javascript/Jquery? If not what could be a possible solution in PHP? ...

how to return clean javascript from a rails3 custom view helper?

Using Rails 3: In my update.js.erb file I found I was repeating a lot of stuff. So I tried to put it all into a helper. But I'm having trouble getting the helper to give back clean javascript. It puts in \&quot; everywhere instead of " Here's what I started with: <% if @list.show_today %> $("#show_today_check_<%= @list.id %>").rem...