javascript

What is more efficient: listeners or functions in jquery

I have been using Jquery alot lately an was wondering if I should use listeners or functions for my clicks. Normally I do the following: <head> <script type="text/javascipt"> function buttonclicked() { alert("You Clicked it"); } </script> </head> <button onclick="buttonclicked()">Click Me</button> ...

images not showing in internet explorer but in firefox no problem

can anyone help me please why my images is not showing on internet explorer 6;7 but in firefox, chrome,avant, IE8 no problem at all... http://previewagency.com/index.shtml ...

Javascript IE error: unexpected call to method or property access

Hi, I have the following code and its working (as usual) in everything but IE. Its giving me a unexpected call to method or property access in Jquery and I have no idea how to debug it. Ive been using the IE developer toolbar, which is useless for this error and just gives me a line no 12 (inside the jquery script). Any help is v much ...

PHP to Javascript, array to array, object to object

I have a list of image paths in my PHP script that I would like to pass to javascript whitout rendering them in the HTML page. I mean, I don't want people go fishing for the path's when do do a > view HTML source. <?php $images_str = "some/dir/001.jpg|*|some/dir/002.jpg|*|some/dir/003.jpg"; $images_arr = array('some/dir/001.jpg'...

How to run javascript in ECMA 5th edition strict mode?

Possible Duplicate: Javascript: use strict Is there any way to know how and which browsers support it? ...

Displaying user input on my page

In our application, we allow user's to write their Bio using a WYSIWYG editor, but it often contains bad HTML that breaks our page. Is it a good idea to show the user bio inside an iframe so it doesn't affect the rest of the page? Or any better options? Thanks ...

Are there any "short tricks" in JavaScript 1.8 that I can use to reduce my golf score?

I have recently picked up golfing as a pastime. I've been trying to golf with JavaScript, and the amount of time I have spent with JavaScript 1.8 is about zero. Are there any nifty shortcuts I might be missing out on in JavaScript between 1.5 and 1.8 that I can rely on to reduce my golf score? ...

Preserve TableCell BackColor seted on client side on postback

What is the best way to save BackColor of asp:Tabel TableCell set on client side by javascript on posback ? What property do I override while creating custom control based on Table ? ...

YSOD Yellow Screen Of Death JavaScript RegExp - Syntax Error

I built up this regex at http://regextester.com to parse YSOD but VS is complaining about a syntax error. I am sure I am missing an escape somewhere but I am coming up blank. Here is is in original form. any help is appreciated. var rxYSOD = /<!--\s*\[(.*?)]:(\s*.*\s(.*\n)*?)\s*(at(.*\n)*)-->/gs; UPDATE: Kobi pointed out the obvious...

What mouse event?

Ive noticed that if i mouse-down on a button, move my pointer from the button area, then return to it without releasing the button it still remembers that i have 'mouse-downed' on the button. Im trying to set button styles appropriatly, could anyone enlighten me as the correct javascript/jquery event to use for this? I would really hat...

Calling javascript on webpage from static method in BHO

Im writing a BHO for internet explorer where i need to call javascript methods on all open browser instances from a 'static' (or a 'global') callback method. I'm running into issues that i'm sure are related to multi-threading in COM. I had few general questions regarding this (i am new to windows programming!). Every browser would hav...

Does the midori js framework support chrome browser?

Does the midori js framework support chrome browser? ...

Is everything in Ext js blue?

Sure, the blue is nice and it has a nice office look but you wouldn't want all applications to have the same color. Is it easy customize the look in ext js? ...

CSS/JavaScript: get user-visible text of an element

Suppose I have the following HTML: <div id="test"> <span style="display:inline;">foo</span> <span style="display:none;">bar</span> <span style="display:inline;">baz</span> </div> .. is there some way in JavaScript for me to get the output "foo baz" (not "foo bar baz")? $('test').textContent returns the latter, and innerHTML doe...

Replace a DIV with a HTML File

Hi, I have created a horizontal menu with 5 tab options using a ul and 5 li tags that is held inside a div Below this area, I have also create a separate div (id="content1") that will be used to display the content html files based on the tab options selected. What I am unsure how to accomplish using both JavaScript and jQuery, how ca...

Dom loads two times

Hello everybody! I have a very weird problem. I am using jQuery and i am using the $(function () to load functions when the dom is loaded. But with a unknown reason the code in the $(function () will run a second time. A preview is at: http://development.devhouse.nl/news/3/het-nieuwste-nieuwsbericht you will get 2 alert prompts, but the...

jquery array of checkbox not sent to php file

to gather the value from the check boxes: var filtersArray = $("input[@name='filters']:checked").map(function(i,n){ return $(n).val(); }).get(); Posting to php file $.post("php/performSearch.php", { keywords: $('#keywords').val(), 'filters[]': filtersArray}, function(data){...

JavaScript date: How to add a year to a string that contains mm/dd?

Hola, I have an string that contains month/date and I need to insert the year. The string looks like: Last Mark:: 2/27 6:57 PM I want to convert the string to something like: Last Mark:: 2010/02/27 18:57 In this case, there will not be any entries more than a year old. For example, if the date were 10/12 it can be assumed that the...

js not working on IE but working on FF.....giving inner.html error..so want to convert in jquery format

Why this javascript working fine in Firefox but not in IE 6 and 7 ( haven't checked on IE8)? giving inner.html error. Can any jquery expert convert this whole code into jquery? as i'm already using jquery on same site for other things. function twoDecPlaces(theValue) { var nm = new Number( Math.round( theValue * 100 ) ) /100 ; var par...

jQuery show/hide multiple 'Other' input fields based on select drop down

I am using the follwoing jQuery to show/hide an 'Other' title field on page: $('label[for=customerTitleOther], #customerTitleOther').hide(); $('.jTitle').change(function() { if($(this).val() != 'Other') { $('label[for=customerTitleOther], .jOther').hide(); } else { $('label[for=customerTitleOther], .jOther'...