javascript

Visible jump before js runs

Hi, I've written a script that takes an unordered list and turns it in to an accordion. As the page loads I notice that before the JS has run the list still shows as normal for a second or two and then is formatted in to the accordion by the js. I can't edit the CSS to hide the list and the show it once js loads because I want to provide...

How to keep variable in scope

I have an associative array of objects that I want to extend with a number of functions. myCtrls //Array of objects I do this with the following loop $(document).ready(function() { for (ctrlName in fieldCtrls){ var ctrl = fieldCtrls[ctrlName]; ctrl.Initialize = function(){ //Do some stuff ...

Is there a way I can compile Javascript using my C# code?

Hey Guys, Iam building a scrapper which needs to scrap some web content. Iam facing an issue, the page I need to crawl has loads of java scripts and it seems that the java-script calls are setting up some cookies and some query string parameters for next requests. Iam able to set the cookies by sending requests to the js files, but see...

Regular Expression to pull a path/filename from a string.

Given an input string, I would like to get the output from this in the specified format: filename;path. For the input string: /vob/TEST/.@@/main/ch_vobsweb/1/VOBSWeb/main/ch_vobsweb/4/VobsWebUI/main/ch_vobsweb/2/VaultWeb/main/ch_vobsweb/2/func.js I expect this output string: func.js;VOBSWeb/VosWebUI/VaultWeb/func.js The filename ...

Accessing remote RSS feed using Google Feeds API

Basically my question is not about how, its about Why ? :) Now i will tell what what i know, then tell me what i missing (if any). In Firefox you can not access remote XML files such as RSS feed using Javascript, because you will get access denied error. Normally to solve it we implement proxy (Internal page to query the content) so we ...

How to extract a number from this simple string using RegExp in JavaScript?

Hi, I need to extract the number from the following simple string: base:873 where the "base:" portion is optional, i.e., it may/may not exist in the string. How am I supposed to extract the number from the above string using RegExp? P.S.: It's an unfortunate to see such a big difference between other Regular Expression implementatio...

Passing array from javascript to java servlet using Jackson

Hello Im trying to pass an array from javascript to java servlet using Jackson, how this can be done..thanks ...

Referencing a method within an object in JavaScript

In JavaScript, what is the proper way to reference an object's method within the object itself? I'm messing around with Safari Extensions, and I'm trying to make an extension that changes the background color of a div based on the extension's settings. I'm using the following code: function SwapColors() { this.bgColorMe = safari.exte...

how to assign a block of html code to a javascript variable (to invoke a javascript call)

Hi, I want to assign a block of html code to a js variable the html code is <script>alert('test');</script> I want to do this var script = "<script>alert('test');</script>"; document.getElementById('test').innerHTML = script; but it does not work if I substitute the tag (or any other tag) for the tag, then it works. var ...

Concatenating two base64 images in Javascript

Is it possible to do simple string concatenation to 'join' 2 base 64 encoded images together if the images have the same characteristics (width/height/color depth etc)? eg img1 w=100, h=200 img2 w=100, h=200 img1+img2 results in img3 w=100, h=400 intuitively this feels like a stupid question since presumably the encoding includes...

Is there a way to achieve Photoshop-like multiply, difference, etc layer effects with Canvas?

Hi, The title should say it all, I am looking for a way to achieve Photoshop-like layer effects such as multiply and difference (and screen) for Canvas + JavaScript. Also, is there a blur effect for Canvas? ...

Image slideshow and refresher

Hi, I'm wondering how I could have a JavaScript image rotator/slideshow, that each time it displays each image (for 5 seconds), it refreshes from the last time it has shown. Also, as something else, but not requiered, I was wondering if it was possible to have a drop-down list of the image locations down the bottom (there are 12 images)...

Populate form by link click before posting with jQuery

Hey, I'm building a small website with JQTouch and the first problem I've run into yet is with a form. I have a form <form action='action.php' class='jqt' id='ajax_post' method='post' name='pform'> (where the name attribute is there when I tried to access it with document.pform)and within it is a ul list of a elements as follows: ...

Reading the contents of an externally linked file in JavaScript

Is there a way in JavaScript to get the contents of a linked file without making a second GET request? That is, if I have <link rel="foo" href="bar.txt"> the browser should automatically download bar.txt. Is there any way to read its contents without getting it again (i.e. via jQuery's $.get or similar)? Edit I could use a second ...

regex for single lower case word

I am looking for a regex pattern that ensures the user puts in a single lower case word with only letters of the alphabet. Basically they are picking a subdomain. Thanks in advance ...

Get Unique Email Identifier from GMail URL

Hi! At the moment, I am coding an Google Chrome extension (in Javascript) which interfaces with GMail. The extension needs to know the unique email identifier that is present at the end of every GMail URL. Eg. https://mail.google.com/mail/#inbox/11a4ac0cg2bc3330 https://mail.google.com/mail/#label/Archived+Emails/11a4c8b472b...

IE/Chrome: are DOM tree elements global variables here?

Working on an idea for a simple HTMLElement wrapper I stumbled upon the following for IE and Chrome: for a given HTMLElement with ID in the DOM tree, it is possible to retrieve the div using its ID as variable name. So for a div like <div id="example">some text</div> in IE8 and Chrome you can do: alert(example.innerHTML); //=> 'some...

CakePHP: Use some javascript in plugin is error

example 1 : I maked tinymce helper I intent use compress tinymce but it dont run valid if i insert tinymce javascript folder in plugin's webroot. It'll dont compress but if I move tinymce javascript to app's webroot it 'll run compress good. example 2: http://www.jstree.com/ . I must move it app's webroot , too If anyone saw this ca...

jqueryui accordion disable specific according tab

hi i am trying to make a wizard for first time i want to disable all accordion tabs when i click on the link it enable next tab and open it.. i hve this code but it disable all tabs :( thanks $(function() { $("#list1a").accordion({ autoHeight: false, navigation: false }); }); $("#list1a").accordion("disable"); $("#list1a"...

javascript/jquery: code packer/obfuscator

Possible Duplicates: How can I obfuscate JavaScript? What do you use to minimize and compress JavaScript libraries? hi all, 2 questions: i'd like to compress my code, anyone knows which compressor the guys from jquery are using? or is there any free script? (i'd like to use the compressor using an automated asp-script, so...