javascript

JQuery will not exist in future?

Hello I was checking out HTML5 new javascript commands and there is something similar to: var els = document.querySelectorAll("ul li:nth-child(odd)"); This allows you to find all elements by css syntax. But I sure Jquery also has something a little similar to this. The question is, as browsers are getting better javascript APIs... ...

Is there a way to create a loop which while only stop if specific strings are entered?

What I'm trying to do is make a loop which prompts the user for information and will only stop if certain strings are entered. Specifically, I want it only to accept certain letters, both upper and lowercase. Here's what I have so far: do { salesP = prompt("Enter the initial of the first name of the salesperson: ", ""); }while (sal...

Is it possible to use webkit css masks with SVG without an external file?

Webkit allows the use of an external SVG file as a mask for any HTML element. Ie: <img src="kate.png" style="-webkit-mask-image: url(circle.svg)"> Resulting in: (More information here: http://webkit.org/blog/181/css-masks/) Does anyone know if there's a way to do it without an external SVG file? More specifically, can it be done w...

Recreate "Styles" drop down area of Office Ribbon?

I am trying to recreate the "Styles" section of the Office ribbon: http://www.winsupersite.com/images/reviews/office2007_b2_06.jpg I like how it starts out as only one row, then you can scroll through the rows, then click the arrow to expand all into a table like above. Does anyone have any ideas on how to recreate this whole interactiv...

How do I use a regular expression to remove text in Javascript?

Need to search a string and replace value="ANYTHING" with value="", basically blank out the value. Thanks. ...

How to count to 3?

Possible Duplicates: Javascript closure inside loops - simple practical example Javascript closure stores value at the wrong time for (var i = 1; i <= 3; ++i) { setTimeout(function() { alert(i); }, i * 1000); } This alerts "4" 3 times. I know why, but I won't spoil it here... although I forgot how to fix it...

How to fade a div parent and it's respective childrens?

I'm currently trying to use jQuery to fade a particular div which contains a few other child divs. I tought it would work but I think there is more to that... Can anyone help me out what's the best way to fade all the elements of the parent div? Currently using the following, but only the background of the parent div is fading and the...

Under What Circumstances Would Javascript Performance be Worse in IE8 than IE7?

I work for a company that built interactive seating charts using Javascript. Here's an example: http://seatgeek.com/event/show/457624/miami-dolphins-at-new-york-jets-2010-12-12/. In many ways they mimic the functionality of Google Maps. We're dealing with an odd problem--performance for the maps is fine in all browsers except IE8. I'...

Synchronizing loading js files with ajax calls and loading js files with <script> tag

Dear all, consider this: core.js: var core = { all:{}, load: function(jsUrl) { $.ajaxStup({async, false}); $.getScript(jsUrl); }, init: function () { $.getJSON('someurl', function(data) { for(key in this.all) ...

Keep selectbox value after submit

On a website that I'm currently making I placed a selectbox were user's can sort a list of items displayed on the page. When they choose one, the page is being submitted and the selectbox value jumps back to the first default one. Now I want the selectbox to retain value after submitted. Im working in XSLT, so I can't use PHP. Is there...

Rollover Images in Firefox

Hi I have a fairly basic task, but cant seem to find the right answer to, I'm making a set of buttons, you put the mouse over them and they change to a different image, take mouse off, change back... It works fine in Safari, IE, Chrome, Get into firefox and 4 don't work, randomly, not in any sort of order... main.php - news.php - e...

javascript memory problem

Hi, i have some problems with my site. it eats ram like a monster. javascript causes that but i don't know what to do. i use jquery framework and jwplayer(+some listeners) how can I detect which code causes that? ...

(NS_ERROR_DOCUMENT_NOT_CACHED) through firefox same code works for safari

I am getting (NS_ERROR_DOCUMENT_NOT_CACHED) error when I try to access the Javascript code through firefox.I get this error in the contents tab of HTTPFOX. The code is as follow: <html><head></head> <body> <button type="button" onClick="handleButtonClick();">undo</button> <button type="button">redo</button> <select><option value="V1"...

jQuery Mobile - Dynamically creating form elements

I'm creating a web-database driven offline web-app targeted at iOS devices. I'm trying to use jQuery Mobile, but I have a problem in creating the various forms. The form options are taken from a database query, so they are inserted into the page after it has loaded, so the "jQuery-Mobilification" doesn't happen. Taking a quick look th...

Using jQuery validate to upload a form, using ajax in the submitHandler()... not working

I am using jquery validate with a form. I want to submit the form using ajax. When I put the ajax call in validate's submitHandler() The browser hangs. What's going on? The error message I get when I enable the validate method's debug is: uncaught exception: [Exception... "Illegal operation on WrappedNative prototype object" nsr...

Hrefs vs JavaScript onclick (with regard to Unobtrusive JavaScript)

What is best practice with regard to using links/<a> tags with explicit hrefs to other pages in your site (i.e. href="/blah/blah/blah.html) vs having hrefs/divs/etc. that don't have an explicit href and have their onclick set within the document ready handler with JavaScript in say a main.js file. I'm not an expert when it comes to web ...

Trouble creating elements with jquery.append() while looping through jquery.each()

This worked great when there was only one entry in the database, but add another and now I've got problems. Since I'm appending based on class names I'm getting every element appending to a single class. I don't know what to do in order to create two "blogHeadlines" with the appropriate content in each. jquery: $(blogEntries).e...

Compare two timestamps per minute difference?

Hello, I'm looking to do the following timestamp1 = Time.now? timestamp2 = lastSave --- My func would be setting this if (compare (timestamp1 to timestamp2) > 5 seconds Any ideas on how to do this with JS? Thanks ...

javascript - convert localtime to different timezone

Hello, Does anyone know how to convert "Date().getTime()" to UTC? Obviously the getTime() is the users local time so I need a function to get the users timezone, convert the timestamp to UTC so I can then * it by -8 to get the current PST time. ...

Why the "focusin" event handler isn't called ?

Why in the following code the focusin event handler isn't called ? HTML: <div id='wrapper'></div> <div id='button'>Click Here</div> <div id='output'></div> JS: $(function() { $('input').live('focusin', function() { $('#output').html('focusin'); // Why this not happens ? }); $('#button').click(function() { ...