javascript

Matching classes with jquery

I have two unordered lists, a bit like: <ul class="list1"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li class="current">Item 4</li> <li>Item 5</li> </ul> <ul class="list2"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> <li>Item 5</li> </ul> And the goal is, with jquery,...

Get Specific part of a String in Javascript

I have a string containing something like this "Hello bla bla bla bla ok, once more bla können. // this is static: it doesn't change This is a text, this also a text. // this is dynamically added text it can change each time My name mysurename // this is also static text www.blabla.com " Now I have content and I have to get the ...

return value from ajax request to another function

I'm trying to return a value from (transport) to the calling function, but can't seem to get it to work: function createXMLHttpRequest( w ) { var urly = '/users/notes/' + w; var options = { method:'get' , onSuccess: function( transport ) { x = transport.responseText; return x; } , onFailure:...

Adding an additional click event to every element (JavaScript / jQuery)

I'm developing a touchscreen application that, aside from everything else, records the amount of times the screen is used so that the user can be reminded to clean the screen after a predefined number of clicks. I've got the click functions written nicely, all I need now is make sure the function is called on a click. I imagine $('*')....

JavaScript OAuth sign in with Twitter

Hi, I have to integrate Sign-in-with Twitter in my app as below. http://apiwiki.twitter.com/Sign-in-with-Twitter It is browser based app developed in JavaScript I have been refering google code java script OAuth, but im confused how to use oauth/authenticate and how to get the oauth_token Can any one please help me out with some sample...

Inheritance of closure objects and overriding of methods

I need to extend a class, which is encapsulated in a closure. This base class is following: var PageController = (function(){ // private static variable var _current_view; return function(request, new_view) { ... // priveleged public function, which has access to the _current_view this.execute = function() { ...

Javascript Input type

Hi All, In javascript we use input type = file .. to open up a file browser pop-up .. is there a way to limit access to folders .. I want to select a folder then ftp all the files in the folder .. so i need access upto only the folder level and not file level .. i guess it would be tedious to go an manually select every file from the fo...

Javascript select boxes based on previous selection

Hello All, How can I ensure that this does NOT open in a new window?? onclick="ob=this.form.table;window.open(ob.options[ob.selectedIndex].value)"/> ...

javascript date query

Hi, i'm try to point so dots on a graph and label them with a date... its working but having problems converting date string. the script i'm using is below. x is the time stamp but when used i get NaN values when replaced with 1268956800000 for example it works fine. i can see where i'm going wrong i think x is not a value when calle...

jQuery-driven app. won't work without alert()

I have seen a lot of articles on this, but none dealing with jQuery, so here I go... I am implementing a version of a script from http://javascript-array.com/scripts/jquery_simple_drop_down_menu/ into an existing application; however, I cannot get it to work without adding alert('msg...') as the first method within the $(document).ready(...

How to show modalInput div using js code?

I have HTML like this: <a href="#" class="modalInput glow" rel="#newsletter" >Newsletter!</a> This opens a modal window, contents held in the #newsletter div. Since I have not located code for this inside the source of the page, I assume this is an inbuilt functionality of jQuery, and I am not familiar with it. I want to open the sam...

click() (javascript) method is not working in FF

Hi, The following code is throwing two alerts as expected in IE but not in Firefox. Please help. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- function myFunction(){ alert('myfunc'); document.getElementById('mylabel').click(); } //--> </SCRIPT...

problem with select boxes - second options based on first selection

Hello All, I just posted a question about opening in a new window but if I use window.location it doesn't work?? is there a problem with my javascript? <script type="text/javascript"> function setOptions(chosen){ var selbox = document.formName.table; selbox.options.length = 0; if (chosen == " ") { selbox.options[selbox.options....

Vertically floating social icon buttons with jQuery

Is there a way to create sticky (floating), vertical icon buttons for a page using jQuery or other library? The buttons are centered vertically on the left or the right of the screen as a bar, and remain in the same location when the user scrolls. Here's an example of a library that generates the buttons for Wordpress: http://www.clickon...

Call Init from XUL after Page Loads (Firefox add-on)

Hi all, I've been working on some code in js/html and it works great. I'm now trying to package it into an add-on for Firefox, and having some issues getting the XUL document correct. PLAIN OLD HTML/JS In my html test file between the <head></head> I have: <script type="text/javascript" src="js/MyCode.js"></script> At the end of t...

Dynamically pixelate an html image element

I'm to take an image on a webpage, and then use javascript (or whatever would be best suited) to dynamically 'pixelate' it (e.g. into 20px squares). Then, as the user scrolls down the page, I need the image to gradually increase in resolution, till it is no longer pixelated. Any ideas how I could go about doing this? I realise I could ...

Unit conversion in Javascript

I have a question concerning number conversion i JS. I have a number like 1613841.93424 (meters) and I would like it to convert to 1.6 km instead. What JS function should I use for that? Thanks. ...

Javascript cookie delete

If I create a cookie in Javascript document.cookie = 'unseen' how do I delete it when I navigate away from this page? This is the only cookie I am creating on the page. ...

cakephp javascript form

i want to submit a form via ajax javascript to cakephp function. cakephp function accepts $this->data, so i want to convert html form datas to cakephp function acceptable format i.e $this->data(array)... how to do this in javascript(jquery) ...

Is it possible for PHP to generate a fresh page on every Javascript history.go(-1) ?

Hello, I have a PHP page (a.php) which is already sending these headers: <?php header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Pragma: no-cache'); ?> And on the PHP page (a.php) , it has a link to another page (b.html) on b.html, it has a javascript...