javascript

how to clear or replace a cached image

I know there are many ways to prevent image caching (such as via META tags), as well as a few nice tricks to ensure that the current version of an image is shown with every page load (such as image.jpg?x=timestamp), but is there any way to actually clear or replace an image in the browsers cache so that neither of the methods above are n...

Javascript Regexp - Match string pattern except if string is inside specified tag

Hello I am trying to replace all occurences of ???some.text.and.dots??? in a html page to add a link on it. I've built this regexp that does it : \?\?\?([a-z0-9.]*)\?\?\? However, I would like to exclude any result that is inside a link : "<a ...> ... MY PATTERN ... </a>", and I am a little stuck as to how to do that, all my attempts...

Does Silverlight have a performance advantage over JavaScript?

At a recent discussion on Silverlight the advantage of speed was brought up. The argument for Silverlight was that it performed better in the browser than Javascript because it is compiled (and managed) code. It was then stated that this advantage only applies to IE because IE interprets Javascript which is inefficient when compared to...

JavaScript: Check if mouse button down?

Is there a way to detect if a mouse button is currently down in JavaScript? I know about the "mousedown" event, but that's not what I need. Some time AFTER the mouse button is pressed, I want to be able to detect if it is still pressed down. Is this possible? ...

Should DOMNodeInsertedIntoDocument bubble?

I've been always thinking that DOMNodeInsertedIntoDocument/DOMNodeRemovedFromDocument events should not bubble, and for me that made enough sence. However, just recently I looked into specification once again and found out that in one location it says these events should not bubble (Complete list of event types), while in other location ...

What CSS/JS/HTML/XML plugin(s) do you use in Eclipse?

I'm looking for a good plugin for doing web front end work in Eclipse. I don't want something that completely takes over eclipse, or something that has masses of dependencies that need to be updated all the time, or something that is geared towards a particular server-side platform, or something that costs a heap. Is there something lig...

Javascript Calendar with Drag select for multiple days

Anyone know of a Javascript Calendar that supports drag selection for multiple days? Need to be able to do it over months as well, not just restricted to one month. Thanks a lot in advance, the ones here are no good for my problem: http://www.javascript-examples.com/javascript-calendars/ ...

jQuery to find all previous elements that match an expression

Using jQuery, how do you match elements that are prior to the current element in the DOM tree? Using prevAll() only matches previous siblings. eg: <table> <tr> <td class="findme">find this one</td> </tr> <tr> <td><a href="#" class="myLinks">find the previous .findme</a></td> </tr> <tr> <td cl...

word wrap in css / js

I'm looking for a cross-browser way of wrapping long portions of text that have no breaking spaces (e.g. long URLs) inside of divs with pre-determined widths. Here are some solutions I've found around the web and why they don't work for me: overflow : hidden / auto / scroll - I need the entire text to be visible without scrolling. The...

Best javascript combo box?

A combo box is an auto-complete text box that is also a dropdown (i.e., you can choose from a list if you prefer). "Best" means combination of: stable, look/feel, API / customizability, maturity. ...

Is there an equivalent for var_dump (PHP) in Javascript?

We need to see what methods/fields an object has in Javascript. ...

HTML form submission in Opera

The HTML form shown below does not work as expected in Opera (Version: 9.52). The form does not have an onsubmit attribute nor does it have an input element with type=submit. It just has two input elements of type=button and both of them onclick calls a js method where I want the user to confirm the submission. If I remove the confirm() ...

variable not being passed?

Hello, I have this code while($row = mysql_fetch_row($result)) { echo '<tr>'; $pk = $row[0]['ARTICLE_NO']; foreach($row as $key => $value) { echo '<td><a href="#" onclick="GetAuctionData(\''.$pk.'\')">' . $value . '</a></td>'; } which gets pk. pk is then passed on to the axjax part with this: function GetAuctionData(pk) { ..... var...

How to find duplicate rows in a join text file

I have recently converted 10 JavaScript files into one file, which I then run a JavaScript compiler on. I just had a bug where I had reused a function name. Is there a tool to check for duplicate rows/function names in the combined file? Or should I create a little program? ...

removing text layer and replacing with image

Hello, I have this code, which works fine, but I would like to be able to make it so when an image appears the text layer disapears, and there would be a link to bring the xt back and remove the image. How would I do this..., something to do with changing isibility and overlaying? <html> <script type="text/javascript"><!-- function sbo...

How to parse XML in JavaScript from Google

I want to parse this XML Document http://www.google.de/ig/api?weather=Braunschweig,%20Deutschland I want to be able to read out condition, temp_c and humidity. All this I want to do inside of JavaScript without using any server sided scripts such as PHP and I want it to work on modern browsers as well as IE7 and if without many problems ...

"Cut and Paste" - moving nodes in the DOM with Javascript

I have html code that looks roughly like this: <div id="id1"> <div id="id2"> <p>some html</p> <span>maybe some more</span> </div> <div id="id3"> <p>different text here</p> <input type="text"> <span>maybe even a form item</span> </div> </div> Obviously there's more to it than that, but that's the basic idea....

javascript: accessing global variables inside a callback

I am having problem with the following javascript - var bVisited = false; function aFuncCallBack(somestring) { bVisited = true; } processingManager.setCallBack(aFuncCallBack); processingManager.DoWork(); if(bvisited == false) alert("Call back not entered"); aFuncCallBack gets hits in my case; I am setting the bVisited to t...

How do you read CSS rule values with JavaScript?

I would like to return a string with all of the contents of a CSS rule, like the format you'd see in an inline style. I'd like to be able to do this without knowing what is contained in a particular rule, so I can't just pull them out by style name (like .style.width etc.) The CSS: .test { width:80px; height:50px; backgrou...

Follow a URL using JavaScript

Is there any way to follow a URL in JavaScript without setting the document.location.href? I have a page that displays a list of objects and each object may have a file download associated with it, which is accessed via a hyperlink. Clicking the link initiates an AJAX request that ultimately leads to a transient file being generated tha...