javascript

Call objective c method from javascript with parameter

Hi all, i succeed to call a objective c method from a javascript method...using the following ///javascript function hi() { CallNKitAction("callFromJavascript className=TestCarouselViewController&index="+index); } hi(); ////objective c -(void)callFromJavascript { NSLog(@"Before:%f",refToSelf.caro...

JavaScript Quiz?

Is this an equivalent 'JavaScript Quiz' site/book to things like : o Ruby Quiz : http://rubyquiz.com/ o Python Challenge o Perl Quiz of the Week I want to improve my object oriented JavaScript skills (i.e. more than striped tables or annoying popups that JavaScript is infamous for). More like 'proper' NodeJS style development. Tha...

regex and javascript

using http://www.regular-expressions.info/javascriptexample.html I tested the following regex ^\\{1}([0-9])+ this is designed to match a backslash and then a number. It works there If I then try this directly in code var reg = /^\\{1}([0-9])+/; reg.exec("/123") I get no matches! What am I doing wrong? ...

jQuery: Executing code for each element that matches a selector

$("p") references all paragraphs on the current web page. Is it possible to execute code for each element that matched the selector? Here's a simplistic example in pseudo-code: // Show the background color of every paragraph on the page foreach (object = $("p")) { alert(object.css("background-color")); } ...

how do you include an external script using javascript in windows script host cscript.exe

how do you include an external script using javascript in windows script host cscript.exe ...

How to repeat or loop this queue on jQuery?

Hi, This is code for a faded slideshow. Is there a way to repeat or loop this queue? To start again on this top code $("#page2_image").hide(); Here's the code in jQuery: $(document).ready(function(){ $("#page2_image").hide(); $("#page3_image").hide(); $("#page1_image").fadeOut(10000); $("#page2_image").fadeIn(10000).fadeOu...

How to illuminate a browser window/tab when something interesting happens in the page?

Possible Duplicate: Make Browser Window Blink in Task Bar Hello I want to notify that something interesting has happened in a web page which is in a browser window or a tab. Eg. In Gmail chat, if you are in a different tab/window and if some one pings you in the chat the tab glows and shows some description running. How to...

JavaScript - How to make a sliding image viewer?

Hello. Can anyone explain how to create a sliding image viewer using javascript or jquery? From the ones I've seen, it looks like all the images are side-by-side and then buttons move the images across depending on the width of that image. Which shows the next image. There's one of these image viewers here. I'm not after the scrollbar th...

How do you implement Javascript onfocus() and onblur() for a password field?

According to my title how to implement the onfocus and onblur to the password field? Default value is password (readable) and when we click the password field it will return to password format. Here an example, I don't want to see "●●●●●●●●" but "Password" instead <input type="password" name="password" value="password" onfocus="this.v...

Jquery addClass function fails in IE7 for td element

For the following HTML: <td class="width2 padLeft" id="loading_45">&nbsp;</td> the following JQuery: $('#loading_45').addClass('loading'); With the following css definition: td.loading { background-image:url("../images/icon_loading_circle.gif"); background-position:left center; background-repeat:no-repeat; height:...

How do you select the last visible element with jQuery?

Hello, I am using jQuery and I want to select the last visible element with some class e.g. 'target' how can I do that ? ...

Creating associative arrays in JavaScript

Using the following code: $credits.getCredits = function() { return $(this).find( 'tbody' ).children( 'tr' ).map(function(){ var $name = $(this).children(':first').html(); var $role = $(this).children(':nth-child(2)').html(); return { $role: $name }; }).get(); } Which looks through the elements of a cr...

jQuery submit ajax form with 2 submit buttons

im trying to achieve the following, in php i have a form like this: <form method="post" id="form_1" action="php.php"> <input type="submit" value="add" name="sub"/> <input type="submit" value="envoi" name="sub"/> </form> the form action file is: <?php if( $_POST["sub"]=="add"){ ?> <script> alert("") </script> <?php echo "ZZZZZ...

A free alternative for ExtJS

Hello everybody, I am looking for a framwork such as ExtJS with smiliar controls and the important thing: The Layout. ExtJS is my favorite framework, but i can't afford it at the moment for some commercial projects i want to make. I have looked at Mochaui, but that does not have the same experience that i had with ExtJS. Does someone ...

JavaScript animation sleep time tuning

Hi Everyone- I know there are a lot of good JS packages that exist that include animation libraries, but there is a simple animation that I am writing that slides a DIV around a page. Needing all of Jquery for this seems like overkill. The animation is workig great, and now I just want to tune it so that it moves as smooth as possible...

How to remove one Class Value from a Two Part Class Setup

Hi, I have the following piece of code: if((String(parent).length > 0) && (String(this.className).length > 0)) { where this.className contains the value "top currentMenu" Using this.className name, I need a means of removing from this.className, "currentMenu" ONLY using jQuery, so that the end result for this.className is just "top"...

Uploading large files with ASP.NET: what are the best practices?

What are, nowadays, the best practices for uploading a large file (which may cause a timeout) with ASP.NET Web Forms and/or MVC? Increase Server.ScriptTimeout (only for the specific POST request); Use some flash client-side uploader like swfupload ( http://swfupload.org ) or plupload ( http://www.plupload.com/ ), but Flash uploads have...

Fitting a <ul>'s width to accommodate the menu items

I have a menu that contains submenus. Its HTML source looks like this: <ul id="menu"> <li> <a href="javascript:;">Menu 1</a> <ul> <li><a href="javascript:;">Item 1<a></li> <li> <a href="javascript:;">Subitem 1</a> <ul> <li><a href="javascript:;">Subsubitem 1</a></li> </ul> </...

canvas.getImageData: "Uncaught Error: SECURITY_ERR: DOM Exception 18"

Hi, I've read that it is not possible to use getImageData on an image loaded from a different domain. Any trick to overcome this? Thanks ...

JavaScript Flash Embed Error

hi i have the following page: [here][link removed] the script i wrote is working fine. but the script attached to the flash player which i have no control over is throwing a script error (im using IE8). any ideas as to how can i fix this? if i run it locally there is no error. thanks. EDIT: says 'null' is null or not an object...