I am trying save the disabled property value of a hidden field to track the disabled state of a button between postbacks, with the following javascript
function TrackState(buttonID)
{
var trackingField = document.getElementById("_tracking" + buttonID);
return false; // prevent default action
}
HTML
<input type="hidden" name=...
I'm trying to write a Greasemonkey script to update the onclick value of a bunch of links on a page. The HTML looks like this:
<a onclick="OpenGenericPopup('url-99.asp','popup',500,500,false)" href="javascript:void(0)">text</a>
I need to update the url-99.asp part of the Javascript into something like urlB-99.asp. In my script, I'm...
What is the difference between using call and apply to invoke a function?
var func = function(){
alert('hello!');
};
func.apply();
vs
func.call();
Are there performance differences between the two methods? When is it best to use call over apply and vice versa?
...
I'm having a problem passing parameters that I think I should be able to solve elegantly (with 1 line of code) but I can't seem to solve the issue. I have a link to delete items, like so:
<a href="javascript:confirmDelete('${result.headline}',${result.id});">
The problem arises when result.headline contains characters like ' or " o...
This seems to be quite a common theme and a few people have given some very constructive answers, but I'm still struggling to get my attempt to work.
The problem is much the same as this one for example, except that I'm only trying to send a single complex object instead of an array.
My controller looks like this:
[AcceptVerbs (HttpVe...
Suppose i have a main js file on the website that contains some code as follows:
$.fn.extend({
break: function(){
//code here
},
cut: function(){
//code here
},
// ...many other methods
});
and i use it like so:
$('#mydiv').break().animate() ...
Now if i add an external jquery plugin file that also has a 'break' m...
I have some JavaScript that doesn't work correctly on the Blackberry 8300. The page renders differently if JavaScript is disabled. However, I'd like to be able to have the page render the "JavaScript disabled" version also if the user is on a Blackberry 8300 or on a media of type "handheld".
Is there some way I can do this? Or some chec...
I have some JavaScript to toggle a dropdownlists in a ASP.NET page , which gets called when I click a button. I have like 4-5 dropdownlist/Toggle button pair. Each toggle button toggles the enable/disable property on the associated dropdownlist.
I save the disabled property value of a hidden field to track the disabled state of a button...
function() { var w = new Object(), w.x = 10, y = 11; }
SyntaxError: Expected ';'
whereas,
function() { var w = new Object(), x = w, y = 11; }
produces no error and x does have w. What is wrong with the first one?
...
In Jquery I would like to know how to trigger/click an a href... link that's within a .php page. This page is dynamically generating two links that I'd like to trigger using left and right keyboard arrow keys for paging next and back through a site. The links are two images within two divs. I attempted to use this but was unable to get t...
My Ruby on Rails app is using LivePipe Modals. ( http://livepipe.net/ ) Everything has been fine until I added a "width: 800px;" property my CSS file. Now, IE7 freezes solid whenever I open a Modal.
I have a div with the squeeze class wrapping the content of my page.
div.squeeze {
width: 800px;
margin: auto;
}
If I take out ...
Hi, is there a way to attach jsondata to a POST request for loading a store? I know it's possible through a GET request by simply adding params : {data1 : 1, data2 : 2} on the load call, but I've had no success attaching jsondata. I've tried the following and a few variations of it and no luck. I'm using Extjs 2.2 w/ Alfresco
//creat...
I find myself learning web development. And I just started reading about javascript. As a language, i don't have any trouble with it, but i come across an annoying situation:
I was just going to try my first javascript for a simple action: changing the src attribute of an <img>. So let's imagine i have this code in index.html:
<html>
...
Happy New Year 2010 everyone!
I have a question on JavaScript events.
Lets say I have an event attached to one element, but I want to update another element when it fires.
var el = document.getElementById("el"),
el1 = document.getElementById("el1");
el.onmouseover = function() {
// Here I want to update for example the inne...
I am using a template to build a one page portfolio site. The contact form is acting very strange! I cannot enter space in any of the contact fields. Here is the site: www.cloth2clay.com
When you focus in on the message field, it does not allow you to use any spaces. Any ideas?
...
Is the doctype part of the DOM, and if so, is there a good cross-browser way to read it? I'm not trying to do anything fancy. I just want to access the doctype information from within some JavaScript code. Read-only access is fine.
...
I'm very new to .NET and this is driving absolutely crazy. I want to pull a value from my database and then assign it to a variable that I can pass into javascript. Printing the value is easy, but does nothing for me!
<asp:Repeater ID="Repeater3" runat="server" DataSourceID="SqlDataSource11">
<ItemTemplate>
<asp:BoundField DataFi...
I have been looking at jquery plugin and was wondering how to adapt that plugin to turn a number (like 4.8618164) into a 4.8618164 stars filled out of 5. Basically interpreting a number <5 into stars filled in a 5-star rating system using jQuery/JS/CSS. Note that this would only display/show the stars rating from an already available num...
I would like to interpret data from JSON feed using jQuery getJSON.
$(function() {
$.getJSON('http://gdata.youtube.com/feeds/users/raywilliamjohnson/uploads?alt=json-in-script&callback=showMyVideos2&max-results=30', function(data) {
$.each(data.feed.entry, function(i, item) {
updated = item.updated;
...
The following javascript snippet will change the type of an INPUT, for instance from text to password. It's being used to allow users to display their password on-screen when typing it in:
document.save_form.password_confirm.type= 'text';
...
document.save_form.password_confirm.type= 'password';
This works great in FF/Chrome but in IE...