I want to execute a local program on my computer via Javascript in Chrome. In Firefox, it can be done as follows (after setting 'signed.applets.codebase_principal_support' to true in about:config):
function run_cmd(cmd, args) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var file = Components.class...
Hi guys i previously asked a question and got a good solution. here is the question:
http://stackoverflow.com/questions/2536892/jquery-how-to-find-an-element-which-is-comming-2-elements-before-current-element
when im using the solution which i got :
paragrafheading.push($(this).closest('> h3').find('> h3').text());
im getting only [...
Hello everyone, I ran into a bit of trouble while trying to load an external HTML page into a div using jQuery-ajax.
I had this div: <div id="content"></div>
and wanted to fill it with $("#content").load("include/add.html");
It loads the HTML file perfectly, but inside that add.html is a button that should load add2.html(also using .load...
Our Client requires that we supply Widgits for their site. They want to link to us to get Html & the jQuery required to manipulate the Html and do asynchronous requests. I understand that there are cross-domain security limitations that would prevent this from being a possibility, but that some of those limitations are aleviated by using...
The Async Tracking in google analytics looks like this:
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http...
Hey there,
I've got a prototype having a method I can add callbacks with:
/*
* Add a callback function that is invoked on every element submitted and must return a data object.
* May be used as well for transmitting static data.
*
* The callback function is supposed to expect a jQuery element as single parameter
* and must retur...
can any one tell me regular expression for postalcode of Amsterdam, Netherlands for validation
EX. 1113 GJ
Postal code format according to Wikipedia (thanks to Pekka):
1011–1199 plus a literal suffix AA-ZZ,
e.g. 1012 PP
...
I saw JavaScript code which begins with with. That's a bit confusing. What does it do and how can it be used correctly?
with (sObj) return options[selectedIndex].value;
...
I know that javascript doesn't have pointers in terms of a variable referring to a place in memory but what I have is a number of variables which are subject to change and dependent on each other.
For example:
Center (x,y) = (offsetLeft + width/scale , offsetTop + height/scale)
As of now I have rewritten the equation in terms of each...
I have a div which opens when I click a menu button, I am trying to close it if the user clicks anywhere after it is open. The issue I am having is that with my code the show div and the close div when a user clicks I guess are firing at the same time for some reason. The code for the click event is below. How can I make it so they do no...
Greetings!
I'm doing a Form on ASP.NET MVC 2, in my view I have a TextBox for the name, and two buttons.
One of the buttons is for submit, and the other one have a function in JS, that add's another textbox, and a drop down list.
In the post controller action method, how do I get all the parameters?
Here is the View Code:
<body>
<...
This may be dumb question. But somehow this engaged me for sometime and after some basic research I couldn't find an answer.
I was learning JavaScript and a code I wrote had an error and has been outputting infinite loops of alerts. I tried the normal shortcuts like Ctrl + C and Ctrl + Z but they didn't work. So I was thinking if there ...
Hello,
I'm trying to implement SWFUpload into an existing PHP upload funcitonality. My current backend script however expects 2 fiels to be uploaded in a single php script execution. (e.g. it excepts the $_FILES parameters to contain 2 entries).
So i'm queueing 2 files with SWFUpload and start uploading them. However it appears SWFLUpl...
Can someone help me with url hash?
I use this code to get the current url and then send the data as json, but the hash part seems to be stripped then.
i tryed to use href and hash and i always get the default.aspx but no hash part like #anchor.
var location = String(window.location);
var title = String(document.title);
var text = { '...
Hi,
I'm using a javascript object to populate a dropdown based on a previous input.
My object looks like the following:
var cars = {
'A.C.' : ["16","16/80","16/90","2 Litre","2-1","3 Litre","428","Ace","Aceba","Cobra","Greyhound","Me","Shelby"],
'Alfa Romeo' : ["145","146"]
}
Its bigger than that but you get the ji...
Can any body throw me some arguments for using inline functions against passing predefined function name to some handler.
I.e. which is better:
(function(){
setTimeout(function(){ /*some code here*/ }, 5);
})();
versus
(function(){
function invokeMe() {
/*code*/
}
setTimeout(invokeMe, 5);
})();
Strange question, but w...
Is it possible to get the target element in a keypress event handler in a design mode iframe ? I know it can be done in the mousedown event handler (by accessing event.target), but in the keypress / keydown handlers event.target is always the iframe element. For example, with the following html, if the user types into the div where it sa...
I've got this simple function which displays a message to the user. If I add the timeout parameter it will slide back up automatically if not the user has to click it to get rid. But the timeout bit isn't working.
function feedback(text, timeout){
$('#feedback').text(text).slideDown('fast');
$('#feedback').click(function(){
...
There is currently this Prototype code that does a PUT:
new Ajax.Request(someUrl, {
method: 'put',
parameters: { 'foo': bar },
onSuccess: function(response) { } .bind(this)
});
I found this post but the solution uses an extra parameter supported by RoR, however I am targeting an ASP.NET backend.
I searched a bit and found...
I have link that calls a function when clicked:
<a href="javascript:spawnMenu(this);" id="link1">Test1</a>
To make my function work, I need access to the object so that I can perform jQuery operations like this:
alert($(objCaller).offset().left);
Since objCaller points to the object and not the object ID, this won't work. I need so...