I need to have an onclick/hover event on an input tag which is disabled.
Is there another way but to wrap it in another tag and give that tag the events?
<input type="checkbox" onclick="cant_choose('event')" disabled="disabled" value="2" name="enroll_to[event][]">
...
Here is the situation:
I have one function which has local variable.
I would like to assign that value to global variable and us it's value in another function.
Here is the code:
global_var = "abc";
function loadpages()
{
local_var = "xyz";
global_var= local_var;
}
function show_global_var_value()
{
alert(global_var);
}...
This is driving me crazy!
Scenario:
The main page opens a pop-up window and later calls a function in it:
newWin = window.open(someurl,'newWin',options);
...some code later...
newWin.remoteFunction(options);
and it's ok.
Now, popup is still open and Main Page changes to Page 2. In Page 2 newWin doesn't exist anymore and I need t...
I was able to instantiate a working scroller using jQuery Jcarousel however I need it to reverse scroll. For example right now I have:
jQuery(document).ready(function() {
jQuery('#mycarousel').jcarousel({
auto: 1,
vertical: true,
scroll: 1,
animation: "slow",
wrap...
This code does not disable my element as expected
if(Multifile.n==0){
$("#btnUpload").attr("disabled","disabled");
}
This code does not enable my element as expected
$("#btnUpload").attr("disabled","");
I added these lines in jQuery.MultiFile.js after what I believe is the location where files are added and removed from the Mu...
hi,
i am looking for code to validate html color codes. wanna check if user typed valid color code, can you guyz help ?
i know i need that regex stuff but i cant understand a think about that regex things :S
thanks
...
Hi, is there a way to know if a variable passed into a function is a native object? I mean, i have a function that requires only native objects as arguments, for every other type of variable it throws an error. So:
func(Array); //works
func(String); //works
func(Date); //works
func(Object); //works
...
func([]); //Throwr error
func({});...
i need to make a drag and drop list for re-ordering which is longer than the screen height.
in order to make this usable, the window needs to scroll while the element selected and the mouse is near the boundaries of the screen.
what is the best way to achieve this?
thanks :)
...
I want to change the output of CKEditor whenever something calls getData() to return the contents of the editor frame.
In this case I have several 's with the "_cke_code" attribute set with some encoded data that I want to transform when exterior code calls getData(). The documentation for CKEditor is patchy at best so I'm kinda stabbi...
I think I have this figured out, but am hoping to cleary have this explained -- what precisely is the difference between these two javascript snippets?
;Person1 = (function() {
var FirstName = 'Hello';
var LastName = 'World';
this.sayHello = function() {
alert(FirstName + ' ' + LastName);
};
});
;Person2 = (function() {
...
I have a strange issue from a client in that our code, which they include uses onbeforeunload() to trigger a dialog, but they are also including another companies code which also binds this event handler.
Is it possible for both to execute at the same time?
I've been reading this, http://oreilly.com/catalog/9780596101992 "JavaScript: ...
I have this code on javascript side:
function changeSelectionStyle(id) {
if(document.getElementById(id).className != 'yes'){
document.getElementById(id).className = 'yes';
}
else{document.getElementById(id).className = '';}
}
And this on html:
<ul>
<li id="selectedAuthorities-4_1li" class="">
<input type="checkb...
UPDATE: Perhaps this wasn't clear from my original post, but I'm mainly interested in knowing a best practice for how to structure javascript code while building a solution, not simply learning how to use APIs (though that is certainly important).
I need to add functionality to a web site and our team has decided to approach the solutio...
My json object looks like:
User { ID: 234, name: 'john', ..);
I want to build a string of all the ID's.
How can I do this? is there a more elegant way than below?
var ids = '';
for(int x = 0; x < json.length; x++)
{
ids += json[x].Id + ",";
}
// strip trailing id
...
I am part of an organization in which there is contention amongst some very competent folks as to whether or not testing cross-browser behavior for JavaScript intensive web applications on virtual machines (for IE6/7/8, FF2/3, Chrome on XP/Vista/7) is reliable. This is using VMWare server on a Linux box host.
While the discrepancies se...
I need a bit of Javascript that will find some text in the html page and then scroll to that point.
So something like "Are you a Lib Dem or Tory supporter and how do you feel about the deal?" would scroll down to the bottom of the page for this bbc news page: http://news.bbc.co.uk/1/hi/uk_politics/election_2010/8676607.stm
Im hoping th...
I have 2 arrays:
var array1 = [50,60];
var array2 = [120,180];
I am passing a value to a variable like this:
var curId = $(this).attr('id');
I want to set the content of #result to a computation like this:
$(#result).text(number * curId[0]);
Number is a variable predefined by me, and curId[0] shoul actually translate to array1[0]...
OK so I now know there is a way to put all my php files in a single place and have them be able to be included without a filepath by setting an include_path like so:
php_value include_path .:/pathToPHPFiles
OK so now as long as my PHP files are in this directory I can include them from any subdirectory as if they were in the same dire...
I want to create a hashtable of json objects, where each json object represents a user.
I want to do this to sort of create a client side 'cache' of users.
User { ID: 234, name: 'john', ..);
So I can then reference things like this:
if(userCache[userid] != null)
alert(userCache[userid].ID);
is this possible?
...
Hi
just wondering if there are any methods in JavaScript that i can use to encode and decode a string using base64 encoding?
thank you
...