Here's some code that has two arrays(np and op), one a copy of the other
However, when I modify the copy, the original is also modified!
take a look:
<script type="text/javascript">
var op=new Array(0, 0);
var np=op;
np[1]=2;
document.write(op+"<br>")
document.write(np)
</script>
Is there any way to retain the original and modify the...
Hello,
is there a way in JavaScript to inherit private members from a base class to a sub class?
I want to achieve something like this:
function BaseClass() {
var privateProperty = "private";
this.publicProperty = "public";
}
SubClass.prototype = new BaseClass();
SubClass.prototype.constructor = SubClass;
function SubClass() {
...
I currently maintain an add-on for Firefox that adds a number of capabilities to a forum web site that implements its own markup language, similar to what stackoverflow provides with "Markdown."
I have built an IntelliSense function for this add-on, which, similar to Visual Studio, will pop up an auto-suggest when typing this markup in ...
I have to download myURLString (http://www.google.com/search?q=http%3A//www.google.com/&btnG=Search+Directory&hl=en&cat=gwd%2FTop).
function getcontents(myURLString) {
var gChannel;
var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
var uri = ioService.n...
Hiya,
I'm trying to find a efficient way to watch the server log on a webpage, i don't mind building an app i just can't work out the best way to do it.
Is there a way to keep a stream open to a file with php and to the browser? or will it have to be done by polling the file every x seconds?
Thanks in advance,
Shadi
...
I have the following javascript to loop through an array of records, and alert the number of matches found within the array, for each field:
mymusic=[{title:"a",artist:"b",artwork:"c",tracks:[{tracktitle:"d",trackmp3:"e"}]}];
tracksArray=[];
trackTitles=[];
var albumScore=0;
var artistScore=0;
var tracksScore=0;
stringToSearchFor="...
Hello,
I am currently working on a Javascript program for my company (Leader Technologies) that is used to register products for Logitech. The URL for that is :
http://wwwtest.onlineregister.com/logitechreg/
My program looks totally fine on everything single web browser (including IE 6) that I have tried except Safari 4. On Safari 4, ...
Hi, I want to add some features to webdriver, but since I don't know Java at all, I want to understand the way it works first. So as I get it, there is a firefox plugin (javascript) and there is java code that starts firefox with that extension installed, then this java code listens to a local port and when it gets some command, java sig...
Hi all!
I am working with javascript pseudoclasses in the sense of:
class Foo
---->getName()
---->setName()
---->....
So i can have collections of them to operate with in client calculations.
But, there is some way to handle them "as is" in php?
in other words, pass it like an object where I could do a call to getName, for example.
...
Hi, I am doing some basic form validation.
I have the following javascript function
function fullField(x,span_id)
{
var result=false;
if(x.value==0)
{
document.getElementById(span_id).innerHTML =" Required";
result=false;
}else{
document.getElementById(span_id).innerHTML="";//can use tick <img src='images/site_images/tick....
I've been recently experimenting with prototyping in javascript and I can't figure out why the following code doesn't work. What I would like to do is create a new instance of cheese with parameter n.
function food(n) {
this.n=n;
}
function cheese(n) {
alert(this.n);
}
cheese.prototype=new food;
new cheese('paramesian');
...
My knowledge of Ruby on Rails and javascript is rudimentary so please forgive me if this question has a simple answer. I have a website that needs a multi level dropdown menu. I have adapted scriptalculous drop down menu which is working on a test copy of my website using mongrel. There are several pages each with its own layout. When I ...
I have reasonable experience with PHP, CSS, and javascript/jquery/ajax. I'm taking my first steps learning Flex/Flash/Actionscript and it's already striking me that using flash/SWF could solve many of my problems. For example:
I won't have to worry much about javascript availability e.g. handling the form submit twice like I do now, on...
I have some validation on a text input bound to its blur event. I have a datepicker on this field (the version from jqueryUI), so when you click the field, datepicker shows up, then you click a date and it populates the date into the field as datepicker does. However, right before the date is entered it seems the input field gets its blu...
I've tried and tried... and I can't seem to make this work in IE (tested version 6)
Can anybody help me? IE complains about an error but refuses to tell which error it is...
var a = document.getElementsByTagName("a");
for (i = 0; i < a.length; i++) {
if (a[i].getAttribute("class") == "info-link") {
a[i].onclick = function(...
Hi,
I'm trying to create a web form that contains checkboxes, among other input elements, and I'd like to provide the user with the abilituy to check and uncheck the boxes when clicking on the enveloping div element.
Here's an example of the HTML:
<div class="line">
<input type="checkbox" />
<p>No, I don't want more newsletters</p...
$(document).ready(function() {
$("#firstTimeSubmit").click(function(event) {
event.preventDefault();
var name = $("#firstTimeText").val();
if (name == "" || name.length > 12) {
$("#updates").html("<b>Dummy! Invalid name!</b>");
} else {
$.ajax({
type: "GET",
url: "http://hiscore.runescape.com...
I'm trying to find a scriptaculous script (or create one) which keeps a vertical navigation bar "sticky" inside my viewport. While this may not be black magic (one could use the position:fixed css) there is a problem with this approach: If the navigation bar is longer than the viewport height the visitor won't be able to ever see the who...
With my two attempts at getting a message posted to the JSpec Google Group having apparently failed, I'm posting here instead.
I'm having trouble with JSpec apparently going into an infinite recursive loop with a certain kind of test (below). Any ideas? It there something wrong with my code or is it JSpec? I'm Running JSpec 2.11.2 via R...
Is jQuery able to read JSON data from X-JSON HTTP headers returned by the server? I've been searching through the jQuery docs, but all the examples I can find use JSON returned in the request body rather than the headers.
...