I have html file with javascript code the contents of the file are as under:
I tried this code on Safari and it was working fine. But when I tried this on Firefox, it’s not working. Can any one suggest how to make it working on firefox.
<html><head></head><body><button type="button" onClick="handleButtonClick();">undo</button> <button...
I'm looking to learn how to build something that detects key-presses in order to throttle a function.
Something like:
var LastKeyPress;
function hitTheServer() {
if LastKeyPress > 2 seconds ago {
hit the server and do stuff
LastKeyPress = now();
}
}
What do you think? Maybe this is built into jQuery? Also, its something that...
Hi - I'm having what I hope is a simple-to-fix issue.
Basically, I've got one block of javascript containing the function, and then I'm trying to call it from another block of javascript (within a jQuery $(document).ready function). Whilst it works fine on Firefox, I get an 'Object Expected' error in IE7. It's probably something to do w...
Have a regex:
.*?
(rule1|rule2)
(?:(rule1|rule2)|[^}])*
(It's designed to parse CSS files, and the 'rules' are generated by JS.)
When I try this in IE, all works as it should.
Ditto when I try it in RegexBuddy or The Regex Coach.
But when I try it in Firefox or Chrome, the results are missing values.
Can anyone please explain what t...
I am trying to clone a template of a which will be populated with data and then inserted into a table. I'm currently able to use the same .clone() function with other elements on the same page but jQuery refuses to see and clone the template (I'm guessing because its not a block element).
Here is the template:
<tr id="search_result_...
I have the below HTML file. I tried the code on Safari and it was working fine. But when I tried this on Firefox, it’s not working.Can anyone suggest how to make it working on firefox?
On click on undo button I want to retrieve contents from the jsp file. Thats working when I used this code on safari on my mac.. but when I open the same...
I'm very new at using JS and AJAX. Currently I'm working with Google Maps API and I need to store some locations (lat,long) to the server.
What I want to do is store some sort of data in my existing MySQL database in server. I have got some good example as well like the following-
http://www.tutorialspoint.com/ajax/ajax_database.htm
N...
Ok this is a bit of a rant and a question combined - Why the hell is magento so reliant on javascript?? This goes agaisnt all usability guidelines. WHats so annoying is that it even uses buttons instead of correct form submit elements. Why? This makes no sense what sense at all to me.
Why is this and is there a way around it?
...
So I'm just learning javascript to mess with the Google Maps API. I was wondering if anyone had an elegant solution to this problem I'm running into.
A Google Maps route request must contain three things (origin, destination, and travelMode). My travelMode will always be DRIVING. The origin will always be wherever the user is located.
...
On Beauty of the Web, there is a purple/blue swoosh at the beginning, if you are in IE9 or Chrome. How is that done? What is that? How come it only displays in IE9 and Chrome?
...
Here is something so simple
<p:commandLink value="Tom" onclick="document.getElementById('tom').focus()"/><br/>
<input id="tom"/>
When u click on the Tom, the textbox get focus. Great, now try this
<p:commandLink value="Tom" onclick="document.getElementById('tom').focus()"/><br/>
<h:inputText id="tom"/> <br/>
when I click nothing ha...
I'm not sure why, but if you have an element with contenteditable enabled, the first time you enter a space, it'll append a <br> tag into the element. If the element has a space in it by default (<p contenteditable="true">this is a test</p>), it'll be fine, but as soon as the user hits that spacebar (or even copy+pastes a space characte...
What is the best method for splitting or extracting the css properties out of as string and into an object?
var cssProperties = 'background:green;content:"Content;";color:pink;';
The above should result in the following
var theObject = {
background:'green',
content:'"Content;"',
color:'pink'
}
Unfortunately I can not ju...
I am looking at writing a jquery plugin that takes a number of input elemts such as input elements, textareas, select html elements etc and once the enter key is pressed in any of the above items, a input button is triggered. As such, the button is set as the default for the fields. Any tips on doing this?
...
I'm just thinking about the whole site registration process.
A user goes to your site, signs up, and then you tell him you've sent him an email and he needs to verify his email address. So he hits Ctrl+T, pops open a new tab, hits his Gmail fav button, doesn't read a word of your lengthy welcome email, but clicks the first link he sees...
I'm using the YUI 2.7 library to handle a dual-slider (range slider) control in a webpage.
It works great-- however, I wanted to allow users to switch the range values by Ajax-- effectively changing the price range from "0-50,000" to a subset (eg. "50-250") without reloading the page.
The problem is that it appears the values from the ...
How do I get the values of textboxe's along with innerHTML?
For example, if I have
<html>
<head>
</head>
<body>
<div id="getvalue">
<p><input type="text" name="username" id="username"></p>
</div>
</body>
</html>
I need the innerHTML of the particlular id="getvalue" along with the textb...
I'm seeing this in particular when using the jQuery-1.4.3 externs file. The javadocs for that reads
/**
* @param {(string|number|function(number,number))=} arg1
* @return {(number|jQueryObject)}
* @nosideeffects
*/
jQueryObject.prototype.width = function(arg1) {};
I have a call that looks like this:
var w = $(window).width(...
I want to use ajax to retrieve some JSON from another page, but I want to pass along the same GET params that were used to request the original page. How do I do that? Does JS store them in a dict somewhere? Or is there a jQuery solution?
$.ajax({
url: 'mysecretwebpage.com/supersecret',
data: ???
});
...
I have a page where onclick on a button displays the text content from the file in the text area on the page
javascript function
function displayOutput()
{
<?php
$logfile = "hello";
$fh = fopen($logfile, 'r');
$size = filesize($logfile);
if($size == 0)
{
...