javascript

Why is Google Chrome not converting tags/entities?

I keep running into this problem recurring, where Chrome refuses to parse tags/entities on text which is handed to it by JavaScript. I first noticed it with entities like &quot;. It will display &quot; as opposed to " Now I am also running into the problem with <strong> and <em>. It displays <strong>Text</strong> as opposed to bolding ...

Why doesn't Internet Explorer render this page smoothly?

Have a look at this page in IE 8: http://labs.pieterdedecker.be/hetoog/layout.htm It looks okay at first, but try hovering over an item and then taking your mouse off the item grid again. Before After Notice how there's a black border on the right of the yellow item. Also, the font looks different. How can I fix this? ...

Update elements by class in each Prototype selector result

Ok, so i have a HTML structure like this: <div class="content"> <div id="a1" class="article"> <p>content</p> <p>content</p> <p class="info"></p> </div> <div id="a2" class="article"></div> <div id="a3" class="article"></div> <div id="a4" class="article"></div> </div> The goal is to process each article and add inf...

How to Obtain Data to Pre-Populate Forms.

The objective is to have a form reflect user's defined constraints on a search. At first, I relied entirely upon server-side scripting to achieve this; recently I tried to shift the functionality to JavaScript. On the server side, the search parameters are stored in a ColdFusion struct which makes it particularly convenient to have t...

Dynamically Refreshed Pages produced by Python

I've been researching this on and off for a number of months now, but I am incapable of finding clear direction. My goal is to have a page which has a form on it and a graph on it. The form can be filled out and then sent to the CGI Python script (yeah, I'll move to WSGI or fast_cgi later, I'm starting simple!) I'd like the form to be ...

Jelly + JavaScript

Hi. I'm working with Hudson plugins. Jelly views are the most complicated thing for me. So the question is how to use JavaScript code in Jelly scripts? P.S. "Hello World" script is working good but simple "for" loop brings a lot of problems... ...

Stick ID to the HTML element (using js) instead of id-attribute?

Hello! First post on stackoverflow. Hope everything is right! I'm thinking of attaching an ID value to the HTML element itself via JavaScript, instead of using the HTML id attribute. For instance, say that JavaScript variable htmlElement is a div. So htmlElement.cssName would tell us its CSS class. Now, how about doing htmlElement.id...

Use JavaScript to Parse Time

This is probably something easy, but I'm a bit confused how to do this. How can I, using JavaScript, parse only the time from the following ISO 8601 date string: 2009-12-06T17:10:00 In other words, with the string above, I'd like to output: 5:10 PM Any guidance/tutorials on this would be great. ...

Adding ShareThis widget to an asp.net page

Hello guys! I am integrating a ShareThis widget in my ASP.NET web page. My problem is that I need to know via JavaScript when an item (let's say Facebook) has been selected. Here is the piece of code that I have used. The widget provides an "onclick" property which enables a callback to be called when the widget is being displayed but no...

On-Demand javascript

Hi guys, I'm wondering if you guys can help me to perform on-demand javascript using AJAX? If you can help me with a simple example, I would really appreciate it. my question is: how to get a javascript code from my server and execute it? Thanks for the help ...

Can I change a value in parent page's JS from iframe's JS?

I have a page with 3 iframes and this page loads a JS file that has var stayFifty = new Boolean(false); and a function that changes what it does based on this boolean. In an iframe on this page I have an onclick function defined as toggleFifty = function() { parent.stayFifty = new Boolean(!(stayFifty.valueOf())); }; added to a...

Dealing with Negative Numbers in Strings

I have a simple, but perplexing problem, with Math. The following code will take a number from a string (usually contained in a span or div) and subtract the value of 1 from it. .replace(/(\d+)/g, function(a,n){ return (+n-1); }); This works really well, except when we get below zero. Once we get to -1 we're obviously dealing with neg...

Change Menu Styling on fly or pass a param inside jQuery .each iterator

I have a bunch of menu links and want to change their style on click - say you click "about" and it becomes bold and red. I select the items and bind click event to them: $("#nav_menu > *").bind("click",function(){doTrigger(this.id);}); this way I pass the ID of the clicked item to doTrigger. Ok. Now in doTrigger I am trying to itera...

delete XML node using javascript in firefox

Hi, Im trying to delete a node in XML file using Javascript. The used browser is Firefox. Im reaching the node which I want to delete successfuly, then Im trying delNode.ParentNode.RemoveChild(delNode) but when i went back to the xml file on my harddisk, the node was still there. I need to delete the whole node (not only children). If s...

jquery click question

i have an issue. the code is this: $("#button").click(function(event){ $("#threads").html("hi"); }); when i click the button, the text "hi" is just shown in 1 sec. then it disappear. i want it to always be shown after i have clicked. how can i do this? ...

self-hosted online photo editor?

I am looking for an online photo editor like http://services.snipshot.com (Javascript) or picnik.com/info/api (Flash) but I need one that I can host on my own server.. been searching for a while but no results.. any ideas? I also love the idea behind pixenate.com/productinfo/Overview.html but its so expensive. ...

Why does jQuery use "new jQuery.fn.init()" for creating jQuery object but I can't?

I try to create some class based-on jQuery style like the following code. myClass = window.myClass = function(x, y) { return new myClass.fn.init(x, y); }; myClass.fn = myClass.prototype = { init: function(x, y) { // logic for creating new myClass object. } }; I do not understand why jQuery use new keyword for...

jquery, submit form when field loses focus

How can I submit a form when a field (In this case the form only has one field) loses focus? I tried this, but it's not working: $("form").submit(); UPDATE I forgot to mention that the form was created with jquery as well: $("div").html('<form action="javascript:void(0)" style="display:inline;"><input type="text" value="' + oldValu...

How To Authenticate Socks 5 Proxies Inside PAC (Proxy Auto Config) Files

How can you setup PAC files to use SOCKS proxies with authentication? Using this simple PAC file as an example: function FindProxyForURL(url, host) { return "SOCKS 69.123.133.75:7257;"; } How would you connect to that socks proxy using a username and password? ...

[jQuery] Why is $(document).ready not firing for me?

In a php file i have used include to include the following js.php file and prior to that i have included the jquery file. <script type="text/javascript"> $(document).ready(function(){ alert("hello"); }); </script> But it doesn't work. Why? when I skip the $(document).ready function it works. But i need jquery code inside. what ...