javascript

How can I compare two sets of 1000 numbers against each other?

I must check approximately 1000 numbers against 1000 other numbers. I loaded both and compared them server-side: foreach( $numbers1 as $n1 ) { foreach( $numbers2 as $n2 ) { if( $n1 == $n2 ) { doBla(); } } } This took a long time, so I tried to do the same comparison client side using two hidden div elements. Then co...

Writing a mobile phone radio station app - is Javascript/HTML/CSS viable, or do we need to go native?

I want to write an app that will stream MP3s from a server to any of the three major smartphone operating systems in the US (iPhone, Blackberry, and Android). Here is the tradeoff I'm concerned with: if I write the app natively, it will make for the best user experience and give me the capability to add many more features if I want, but...

JQuery modal popup on specific region

I have a grid and when i change its sorting order i a loading message appear on grid region and block its content like other modal popup but only on grid region is there any available jquery modal popup meet my needs ? can I configure jqueryUI modal to do this ? ...

Javascript fade image in and out.

I am fairly new to JavaScript and i need a very simple script to fade an image in and out slowly on a loop. Any help would be much appreciated. ...

jquery find element at a particular position

Hello guys, Is there a method in jquery to select an element located at a particular position for example select the element that is located at left:100 and top:300 ? in absolute position It would be nice if I could select and element located in a range of positions, for example select the element that is located left: 100 - 150 px ...

Javascript HTML > XHTML converter

Looking for a HTML converter which will produce valid XHTML code. One important thing is that it will need to insert P tags for paragraphs - something that seems to be missing from most popular ones. I found John Resig's, but it does not insert P tags. http://ejohn.org/blog/pure-javascript-html-parser/ For example, this: Lorem ipsum ...

How to prevent the calendar from hiding when a disabled date is selected?

I've been check the doc for a while here, but don't find a way to do it,anyone familiar with this? ...

jQuery Ajax Url Path Breaks When Accessed in different directory levels

Hey all, Its time for another very simple question that I can't find an elegant solution for. Basically, I have an app that is using a jQuery Ajax call. In this call, you have to specify a URL path for the service that you are calling. In this instance, I am needing to call this JavaScript function from multiple files in my applicati...

Mark some Javascript blocks as "special"

For some complicated reason, I need to mark some Javascript as "special", like this: <script type="text/javascript" someattribute="special"> var special = "I'm special!"; </script> <script type="text/javascript" someattribute="special" src="special.js"> </script> Is it possible to do this in way that complies with XHTML standards? ...

Appending to External Browser Window

I have a Windows app that contains a browser control that loads pages from my website. However, due to the Windows app, I cannot debug Javascript in the usual ways (Firebug, console, alerts, etc). I was hoping to write a jQuery plug-in to log to an external browser window such that I can simply do something like: $.log('test'); So f...

Mouseovers on image maps in IE8

I'm having a problem with IE (who isn't) executing my javascript. Are there any known issues with attaching mouseovers to image maps in IE8? I'm not seeing any similar posts. For instance, here is the HTML in one of my pages: <map name="Map" id="Map"> <area shape="poly" coords="2,575,389,637,388,19,1,74" alt="Main Page" onmouseover="...

How to convert a number 30.006649999999994 to 30.01 in js?

Anyone knows such a function in javascript? ...

Call jQuery function within function

I have a jQuery function (stripped down just for this example): (function($) { $.fn.Lightbox = function(options) { var opts = $.extend(defaults, options); function initialize() { $('#lightbox').show(); return false; }; function close() { $('#lightbox').hide(); ...

get parameter from url and save the parameter in other links on the same page

Hi all, I have a problem and i need some help please. I have this page with a parameter http://www.webxpress.com/landingpage.asp?label=CSU... Now in this page i have 3 buttons with the following links: www.webxpress.com/button1.asp www.webxpress.com/button2.asp www.webxpress.com/button3.asp All i want is to add the parameter in the but...

Parse a JavaScript file through PHP

Hi everyone :) I have a JavaScript file where I would like to include some php code. The problem is that I have a few defines on PHP that I would like to use on JS as well. Is there any way of including a .js file in HTML allowing the server to first interpret it (before downloading to the client) using php? Thanks :) ...

jquery : find the element below one element

Hello guys, I am creating a simple application using jquery, in this application I can drag an element(DIV) along the document. I can place the DIV at any position in the document, If I place this DIV above another element how can I find out what is the ID of the element that is below the dragging object, for example if I place the dra...

Resolving relative URLs in JavaScript

I'm building a JS library which has a requirement of looking at form[action] and a[href] values and resolving them into absolute URLs. For example, I'm on http://a/b/c/d;p?q and encounter an href value of "../g" (assume there's no <base> element). The resulting absolute would be: http://a/b/g. Is there a JS library that does this alre...

JQUERY: Simple get Offsets of a div.

Hi to all, i would like get the offsets of a div,but when i try to access to that div says me [Object object]... or undefined or 0.0;because i think that my method is wrong :-( This is the code of the page: http://pastebin.org/208836 And i have already tried with this code: var p = $(".product_72ivnj"); var offset = p.offset(); var ...

How do i open and create a file like this ?

Well,my current situation is like this. When i search something on my site for ex. http://example.org/web-search.phtml?search=SEARCHED+TEXT the respective content is shown. As you can see I'm using a GET form to get the data from the previous form.So the first thing i want to do is open a file with the same as SEARCHED+TEXT.So now i wa...

Need slider that can increment exponentially (not using range)

At the moment I am using jQuery UI's slider to allow people to select a donation amount. The problem is, the slider is to small and needs to compensate for the minimum of $1 and the maximum of $10,000. The proposed solution is to use a small increment, maybe $1 or $2, for values between $1 - $1000, and then from there, raising the increm...