javascript

set timeout for jQuery UI draggable() to prevent locking effect

I'm using draggable(), but occasionally the draggable() seems to create a locking effect where the dragging effect persists even after the mouse button is released. Once this happens, the only fix is to refresh the page, which is a terrible way to go for an ajax-based site. So using the UI docs I'm trying to figure out a way to set a ti...

Django templates: insert values for javascript variables

I am trying to assign some javascript variables in a Django template. I am having a problem where the values I am assigning are being written to the page properly (I can see them in the page source), but still come up as null. I am doing this: <script type="text/javascript"> var coords = []; {% for i in item_list %} coords.pus...

Multiple user control instances and ClientID in JS

I am using <%= ClientID %> in the javascript to get the ID of a dynamically loaded user control. Everything works fine until multiple instances of the same control are loaded. The ID points to the ClientID of the user control that was added last. How do I solve this issue? EDIT: I am doing a: var clID = <%= ClientID %> in javascript...

Jquery toggle on window minimize.

I have a div that toggles in and out of display when you click on another div. How could I modify my code so that when the user minimizes the whole browser window it automatically toggles, hiding the div from view so when the user un-minimizes window the div is no longer visible. ...

Culerity vs Selenium for Javascript Testing in Rails

In our eternal quest to integrate Javascript into our RSpec and Cucumber workflow we're evaluating Culerity and are provisionally very excited about it. Any advice on Culerity in general or specifically as compared to Selenium? ...

setting top.location.hash with %20 in firefox

In firefox, using this javascript: top.location.hash = "#here%20are%20spaces"; changes the browser url to: http://mysite.com/#here are spaces I expected firefox to show the encoded spaces as %20 in the browser url. What's going on here? Why is firefox not setting the url to the string as I passed it? How can I force firefox to u...

IE 6 select controls(Combo Box) over menu

In IE 6 select control(combo box) is displaying on top of menus. I checked some javscript menus , mmmenu,http://www.leigeber.com/2008/11/drop-down-menu/, all are getting under select control. Its not fixable by assigning Z-Index. Is there any other solution. ...

Close window response stream excutes Javascript. Why?

I have the same problem description here. I solved this problem by adding the following Javascript code to the aspx page: window.opener = null; window.open ('','_self'); window.close(); The new page opens and pops up a filedownload dialog and the page closes. But I don't understand why the Javascript code executes. The response typ...

How to prevent HttpWatch from 404ing javascript single-line comments

How do you prevent HttpWatch from interpreting javascript single-line comment as call to a missing resource thus resulting in a 404 error? ...

onload from external js file

I'm writing a js script that people will add to their web site by adding a single line of code to the header or end of the body part of their HTML. My question is how to do the onload right on the external js file. Will the code below work? Can't it possibly run after the onload of the document and miss the onload event? function c_onl...

injecting javascript to FireFox...

Hi, I'd like to create a handle through which I would be able to inject javascript to Firefox. I can do it very easily with IE but Firefox is a different story... Can anyone help? ...

Removing all \n\r characters from a node XSLT?

Hi wondered if you could help me please? I have node in xml that is as followed $LOG: 08880xbpnd $ fhdsafidsfsd df sd fsd f sd fsd I was wondering is there anyway to make all the text go on to one line so that it then can be passsed through to a javascript function? so it would turn out like this $LOG: 08880xbpnd $fhdsafidsfsddfsdf...

Sort <div> elements using jQuery

I have HTML like the following on my website: <div class="groups"> <div class="group"> Group 1 priority: <select> <option value="1.0">1</option> <option value="2.0" selected="selected">2</option> <option value="3.0">3</option> </select> </div> <div class="group"> Group 2 priority: <select> ...

scriptaculous draggables: need to cancel onClick action when element is dragged.

Thanks for the three excellent answers which all identified my problem of using "onclick = ..." instead of "observe( "click",..." But the award for Accepted Answer has to go to Paolo Bergantino for the mechanism of adding a class name to mark the dragged element, which saved me some more work! In my HTML I have a table with an image ...

What javascript templating engine do you recommend?

Do you have experience with a Javascript templating engine, one that is stable, easy to use and has good performance? I need to do apply the same template many times for different data. I prefer to download the template itself once (and have it cached) rather than processing the template on the server. Also, this way the template itself...

Get a simliar string a discharge the rest

Hey guys, wonder if you could help me out with some Javascript. I have a string that is log message, and i'm waniting to grab a section out of this log and display that on it's own eg.(bear in mind the log section is not case sesitive and any letter can be any case, also could be placed anywhere withing the string) $LOG: 08880xbpnd $ ...

Fade In/Out and create/hide <DIV> with javascript

Hi I'm creating some on runtime. For that I'm using this function: function creatediv(id, html, left, top) { if (document.getElementById(id)) { document.getElementById(id).style.display='block'; fadeIn(id, 300); } else { var newdiv = document.createElement('div'); newdiv.setAttribute('id', id); ...

Validator in <noscript> causes JavaScript error

The following .NET 3.5 code, placed in an aspx file, will trigger a JavaScript error when the page is loaded (for users who have JavaScript enabled): <noscript> <asp:TextBox ID="txt" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="txt_RequiredFieldValidator" runat="server" ControlToValidate="txt"></asp:Requi...

event is not defined in mozilla firefox for javascript function??

function onlyNumeric() { if (event.keyCode < 48 || event.keyCode > 57) { event.returnValue = false; } } onkeypress=onlyNumneric(); In IE, this code is working fine. However, in Mozilla Firefox, the event is an undefined error. ...

Error when calling ASP.NET web services from Javascript

I'm trying to call a ASP.NET web service from Javascript, and it won't recognize the Web Method, even when I fully qualify the name, I'm trying to figure out what is wrong. Here is the part of my web.config file: <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Scri...