javascript

Best script (PHP/JS) for pop-up accept/deny license agreement?

Hello! I'm looking to create a Pop-up Agree/Deny User License Agreement when people visit any page on my website. Using Magento, if it helps at all. What I'm looking for: Never pop-up's again after user clicks Accept (To prevent pop-up everytime user clicks a link.) Visitor cannot access website until clicking Accept. If visitor clic...

how can i get the functionality of fb:chat-invite using facebooks javascript sdk or xfbml

From this forum entry it appears that fb:chat-invite is not a valid xfbml tag, so to use it one needs to use serverfbml. However testing out <fb:serverfbml> <script type="text/fbml"> <fb:date t="1216170865" format="long_numeric" /> hello again </script> </fb:serverfbml> results in <fb:serverfbml> requires the "fbml" attribute...

getting started with javascript

HI I am learning javascript since last few days, I read it as scripting language. I like to know how it differs from other scriptings. Where does it run ?I mean where exactly my code gets compiled or error is caught? I like to know even any good online tutorial for learning javascript. ...

How to get the value of a select drop down in javascript?

How can I alert the value selected by user from a select drop down box in Javascript. In this example I want to store the value inside a variable and alert it to the user. <script type="text/javascript"> function processmyform() { var chosenAnimal = // what goes here alert(chosenAnimal); } </script> <form action=""> <se...

best jquery way to find and filter and apply css classes

ok say we have <span class="foo">7</span> <span class="foo">2</span> <span class="foo">9</span> and want to apply a css class of 'highest' to 'span.foo'.text > 7 and css class of medium to values > 4 and <= 7 and css class of lowest to <= 4 example of desired result: <span class="foo medium">7</span> <span class="foo lowest">2</spa...

Passing variables to create <h3> and <div> tags using JavaScript or jQuery

Not sure how to use javascript or jquery to make my divs populate with accordian style headings and content. <html> <head> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type...

Techniques for profiling memory in Safari desktop and iOS?

Updated 10/21: Changed title and question in order to possibly get an answer (other than "no"). We're experiencing leaks in Safari (confirmed in Windows and Mac, suspected in iOS). Are there any Safari extensions that lets one profile JavaScript/DOM memory usage to discover potential leaks? Better yet, is there any tool that can be us...

Executing javascript within PHP

I believe it is possible to execute a java script function within PHP, but will it then remain server side as opposed to client side? Can I, within PHP, call a .js function, passing it some args, and have it return to the PHP that called it? A script I want to use returns XML, and I want to get the user inputs using PHP, pass them to t...

How to replace more than once?

This is my code so far: $("h1.intro:contains('|')").each(function() { $(this).html($(this).html().replace('|','</span><br /><span>')) }); This works just once, but it has to work for all of those "|"... any ideas? ...

How to get elements with an ID containing certain text? (Prototype)

I have a set of 3 radio buttons, with these element IDs: id='details_first' id='details_second' id='details_third' How do I get all the elements whose id starts with 'details_' ? EDIT What I'm actually trying to do is this: Each radio button has an associated div that I want to display when the radio button is clicked. At one time o...

Get is() and hasClass() for DOM element

Dear all, I have an element with a class. However, that element is not created when page is loaded, however it is created as a child-element as DOM ele. And each time if i want to check the availability of the class on this element it will return false eventho the class exists. I found out that it is because the element is not created w...

passing a javascript array to a django view

I'm using django and have a page of search results that I want to be able to filter by category with ajax (jquery) requests. There's a filter bar on the side of the page and when someone selects certain categories and clicks submit, those corresponding results should show up on the page. My code looks something like this: <input type=...

Make first and last column not clickable

I have a table being generated in an ASP.net web app. The table has 4 columns. Currently each cell of each row can be clicked to get more detailed info. However, I do not want the first and the last cell in each row to be clickable. How can I make it so that only the first second and third cell can be clicked? Below is some of the code ...

jquery - building up an event for a text field "changing"? (keypress works except no backspace event)

I've got a "search" box that is supposed to be able to search data "live". Right now if I attach the "keypress" event to it and update the results, it works pretty good. However, if they press backspace it doesn't account for that (refresh the results). I understand I can probably account for the "backspace" key. But am I missing any o...

Need a web-embedded editor that doesn't save in HTML

Our clients are able to edit some text on our "admin" web site, which then displays to their customers on another "client" web site. They now want the ability to add mark-up like bold, italic, underline (and combinations of the above) plus links to web pages. Unfortunately, because we use a web framework that passes the stored text thr...

Dynamic params calling window opener

This doesn't seem to work: func = "getProductListings"; params = "{'user_id':1234,'short':true}"; window.opener[func](params); can someone check my code please? ...

Android - Loading an external .js file into a webview then accessing it's functions?

I have a JS file that has functions to search a document for substrings. I want to access functions inside this file by passing parameters to it (the search keyword). I know we can use .loadUrl("javascript:~~~~~) but I'm not clear on how to do it using multiple functions. Anyone who can point me in the right direction? Thanks! ...

How do I resize images and keep the proportion / aspect ratio with jQuery?

Hi, I have images that will be quite big in dimension and I want to shrink them down with jQuery while keeping the proportions constrained, i.e. the same aspect ratio. Can someone point me to some code, or explain the logic? ...

Does 'new Image()' allow for use of cache (JavaScript)

If I use new Image() to load up an image in JavaScript, will it use a cached version if possible, or will it always load up a fresh copy? var imgObj = new Image(); imgObj.src = 'http://...'; imgObj.onload = function (loadedImg) { } ...

How to create modal dialog box like when you try to vote on stackoverflow ?

Hello. I'm looking for some solution for creating modal dialog box, like when you are not logged in or donot have enought reputation, and try to vote on some question or answer at stack overflow... That orange box that is show... Can someone help me? ...