Relative References With Konqueror?

Jul 20, 2005

I discover a strange bug in Konqueror 3.1.1.
I design a javascript application which acts in one file called
example.html. At the beggining of this js i write:

if (document.images)
{
folderopen= new Image(16,16);
folderopen.src="http://www.sergioamo.8m.com/buttons/folder_open.png";
folderclose= new Image(16,16);
folderclose.src="http://www.sergioamo.8m.com/buttons/folder_close.png";
}
functions....
....
...
..
and my javascript works perfect.
If i write:

if (document.images)
{
folderopen= new Image(16,16);
folderopen.src="./buttons/folder_open.png";
folderclose= new Image(16,16);
folderclose.src="./buttons/folder_close.png";
}
functions...
....
...
..
my javascript does not work properly. Does anyone knows if is imposible
to use relative references with konqueror 3.1.1 or which is the problem?

View 2 Replies


ADVERTISEMENT

Konqueror And Opera Problems

Dec 16, 2006

I am creating a chat script that uses PHP and Javascript. For part of it I need to empty one of the text boxes. The scripts I use work fine in IE and Firefox, however the the text box will not clear in Opera and Konqueror. I have tried the follwoing:
document.getElementById('commentbox').innerHTML = ''
and
document.chatform.comment.value = "";

Like I said they are both fine in IE and Firefox, but not in Konqueror or Opera. I have searched for hours looking for code that will work.

View 3 Replies View Related

Prototype.__defineGetter__() Equivalent In Konqueror

Jul 20, 2005

Is there an equivalent in Konqueror's KJS engine to Gecko's
__defineGetter__() and __defineSetter__() methods? Our web application
uses a ton of Javascript, written based on Internet Explorer's object
model as that's the primary platform that we're supporting. For
Netscape support we uses __defineGetter__() and __defineSetter__() to
emulate the many IE-only properties. I've tested our site using
Safari, and to my surprise, it renders perfectly. Alas, it's
completely non-functional. If it's somehow possible, I'd love to write
a similar emulation library for KJS so that our non-Windows users
would have an alternative to crummy Netscape/Mozilla.

View 1 Replies View Related

Onclick Image Coordinates From Konqueror And Safari

Sep 26, 2005

I am trying to capture the image coordinates when a user clicks on an
image. My code is working in Firefox, Mozilla, Netscape, IE, and
Opera, but fails under Konqueror (and I suspect Safari). The code below
fails in Konqueror when the page is scrolled down; the coordinates are
off by the scroll amount.

My code in the html img tag: onClick="MLDot(event)"

and the related statements in the MLDot function:

xPosition =
event.offsetX?(event.offsetX):event.pageX-document.getElementById("clickImage").offsetLeft;
yPosition =
event.offsetY?(event.offsetY):event.pageY-document.getElementById("clickImage").offsetTop;

Anyone know how to pick up image coordinates in Konqueror/Safari?

View 1 Replies View Related

Konqueror/Safari Problem: DHTML-generated Links And Frames

Sep 26, 2006

I have a Web page with two frames.

The left frame has a DHTML-generated tree of links (to images). The
right frame displays the image link you click in the tree of links.

It works great on all browsers except Konqueror/Safari, where it
displays the first image link you click on in the tree of links. But
then subsequent clicks on other links do nothing.

That is, the first time you click on a DHTML-generated link,
Konqueror/Safari loads the corresponding image in the other frame.
However, after that, when you click on links, the other frame is not
updated.

Do you know why this happens?

View 1 Replies View Related

References Themselves Are Passed By Value

Jul 23, 2005

Is it true that Javascript has no clone() method, to pass an object by copy of value instead of reference?

If I have an object and want to make an array out of all of its instance variables, I can loop through it and pass its values to a new array, and the class instances will be passed by copy and not by reference?

Example 9.3: References Themselves Are Passed by Value

// This is another version of the add_to_totals() function. It doesn't
// work, through, because instead of changing the array itself, it
tries to
// change the reference to the array.
function add_to_totals2(totals, x)
{
newtotals = new Array(3);
newtotals[0] = totals[0] + x;
newtotals[1] = totals[1] + x;
newtotals[2] = totals[2] + x;
totals = newtotals; // this line has no effect outside of the
function.
}

Note that this rule applies not only to pass-by-reference, but also copy-by-reference. You can modify an object through a copy of a reference, but changing the copied reference itself does not affect the object nor the original reference to the object. This is a more intuitive and less confusing case, so we don't illustrate it with an example.

View 5 Replies View Related

AJAX References

Oct 23, 2005

I'm currently engaged on a dissertation which is
investigating AJAX technologies and I was
wondering if anyone had any references that might
shed light on the subject?

I will of course carry out a literature review but
in the mean-time has anyone any (preferably print
based) sources of data on AJAX?

View 9 Replies View Related

Object References

Dec 17, 2005

I am a bit new to JavaScript objects, I have the following object:


LinkTest=function() {
// init
}

LinkTest.prototype.eventHandler=function(){
// the call below fails, as 'this' refers to the link that
// generated the event, and not the instance of LinkTest object
this.doSomething();
}

LinkTest.prototype.register=function(link){
link.onclick = this.eventHandler;
}

LinkTest.prototype.doSomething=function() {
// do something!
}

So basically when you register a link, the onclick event handler gets a reference to LinkTest's eventHandler function. Now when the user clicks on the link, the 'this' refers to the link... how do I reference the instance of LinkTest object from within the eventHandler function?

View 2 Replies View Related

Inter-frame References

Jul 20, 2005

Apparently, there is a page with multiple frames, where one of the
frames is a "hidden" frame, and is there just to contain one or more
"fields" that are referenced from other frames.

Supposedly, if a user "sits" somewhere in this set of pages for
several minutes and then tries to do something, the page redisplays,
but an inter-frame reference (to the "hidden" frame) fails with some
sort of a "No permission" error. If the user navigates through the
site with no real delay, they don't see this problem. This is the
situation I need to understand.

I'm assuming that the "No permission" error occurs when a frame that
was obtained from domain "foo" tries to reference a frame that was
obtained from domain "bar" (I'm not sure of the correct terms in the
context of JavaScript). Under normal operation, all of the frame
contents are obtained from the same domain (I believe).

My theory is (without much information yet) that there must be a
proxy/cache server in between. When the user navigates through the
site with no delays, all of the frames are obtained from the same
server (either the cache server or the target server, I don't know
which). However, when the user "sits" for a while, I'm guessing that
the cache server hits a content timeout, and a redisplay of the page
causes one frame to be obtained from the target server, and one from
the cache server.

Does this seem like a reasonable explanation for what we might be
seeing? What are useful strategies for fixing a problem like this?

View 1 Replies View Related

Passing And Using Variables In Object References

Mar 9, 2003

I am trying to make a function that checks/unchecks a checkbox when a specific <td> is clicked. I need to use this same function for several checkboxes in the page so I want to just pass it the name of the checkbox I want to affect as a variable and use it in the object reference lines. BUT, this doesn't work. I can pass the variable to the function as I've used alert(variable) to test this. But it doesn't work when I put it in a line like this "document.forms[0].variable.checked=true;". Code:

View 4 Replies View Related

Shorten Form Element References?

Dec 5, 2010

is there a way to shorten something like:document.scoresheet["HomeTotalHCaps"].valueto a simple short name like var1.value ?

View 8 Replies View Related

Object References When Using Bound Event Handlers

Feb 27, 2007

THE QUESTION: How do I get a reference to my Object when processing an
event handler bound to an html element ?

CONTEXT:
Sorry if it is a bit long.

I am developing a JS calendar tool. One of the requirements is that the
calendar will need to display a varying number of months (1..3)
depending on the calling page. Imagine 1, 2 or 3 calendar pages side by
side as required.

I have built a grid object that will contain one month's dates with the
day names at the top. The calendar object inherits the grid object as an
array of "calendar pages" - one grid per month and the calendar provides
the content for each grid. I will use the grid object for another
completely different object later and so I want to use good OOP
encapsulation. The grid is a table generated on the fly and is "dumb" as
far as what it is used for.

I have attached an onlick event to each cell of the grid. Using OOP
priciples I want the calling program (the calendar object in this case)
to provide a function to handle the click and the grid object will
provide to the calendar the row and column of that cell as well as the
grid number (so the calendar can work out which date was clicked since
it knows what the data means and the grid doesnt). Code:

View 6 Replies View Related

JQuery :: Limited Jqueryui External Css References?

Aug 11, 2009

I'm working on a project that I want the user to be able to change the color theme of the site. For some reason if I go over about 20 themes or css references it breaks the site. Any idea why this is? if so, how can I get it to accept say 50 themes?

View 2 Replies View Related

Closures / Object References And Private Methods

Aug 22, 2010

I have some confusion about the scripts below:

1) is getRule a local variable or global variable, as it has no var keyword, yet it is an inner function of Validation? So without var, I think global, but being an inner function, I think local. So I'm not sure which.

2) In this line of code: var rule = $.Validation.getRule(types[type]), getRule returns rules, which is just a local variable in Validation. I always see that you return functions, but how does returning a local variable that's just an object literal and not a function be able to return true or false? Now the value of rules is an object literal, and this object returns true or false. So we are basically allowed to use return keyword with local variables that are object literals and not functions?

3) In this line, is foo(age) being called, or is it just being assigned to bar OR is it being called and THEN assigned to bar: var bar = foo(age);

4) Now for the most confusing: age is obviously an object reference as opposed to a literal in the example. Does that make a difference in regards to closures?
Note that I read a number of books, including JavaScript Programmer Reference and Object Oriented JavaScript and jQuery cookbook, which compare primitives vs reference types and how primitive types store directly in memory whereas reference tpyes reference memory, so if one reference changes, they all change where primitive remains ingrained. But when assigning a function as a reference like this, how does that affect the object "age" when passed into bar?

Code:
(function($) {
/*Validation Singleton*/
var Validation = function() {
var rules = {
email : {
check: function(value) {
if(value)
return testPattern(value,".+@.+..+");
return true;
}, .....
$.Validation = new Validation();
})(jQuery);

Code:
function foo(x) {
var tmp = 3;
return function (y) {
alert(x + y + tmp);
x.memb = x.memb ? x.memb + 1 : 1;
alert(x.memb);
}}
var age = new Number(2);
var bar = foo(age); // bar is now a closure referencing age.
bar(10);

View 3 Replies View Related

Storing Element References As Public Object Members

Sep 20, 2006

I've spent several days trying to work this out. Maybe I'm just
searching for the wrong keywords/phrases.

I have some code that looks like:

[-- snippet starts --]
Console = new Object();
Console.init = function() {
this.STDIN = document.getElementById('console0_stdin');
this.STDOUT = document.getElementById('console0_stdout');

// set styles on the element references, eg:
this.STDIN.style.width = ļ`%'
this.STDOUT.style.width = ļ`%'
}

Console.focus = function() {
this.STDIN.focus();
}

Console.writeln = function(buffer) {
this.STDOUT.value += "
" + buffer;
}

[-- snippet ends --]

I'm not sure why, but the Console.focus() and Console.writeln() methods
just don't seem to be able to use the DOM references stored in
Console.STDIN and Console.STDOUT. Everything's fine in the
constructor, but other methods can't seem to use them.

View 8 Replies View Related

JQuery :: Multiple - Retain Two References On A Single Page In IE?

Sep 19, 2010

My site's working perfectly in the other browsers, and when I delete line 28 (see below) it works in IE but not exactly how I want. Is there a way to retain two jquery references on a single page in IE?

This is the head section of my code:

View 3 Replies View Related

Test Object Equality Using Data Inside - Not References - Possible?

Jan 29, 2009

Is it possible to test whether two objects are equal using the data they contain inside and not comparing their pointers with ==?

Well actually of course there is but...

Is there a way to do it without actually looping through the object, instead maybe something that came with JS? (something like a .equals() method from other programming languages.)

View 5 Replies View Related

When Closures, Loops, Function References, And Anonymous Functions Interact

Oct 16, 2010

I am confused about the true difference between the two below examples.

first example:

// Demonstrating a problem with closures and loops
var myArray = [ā€œAppleā€, ā€œCarā€, ā€œTreeā€, ā€œCastleā€];
var closureArray = new Array();

[code]....

Here we iterate through the length of myArray, assigning the current index of myArray to theItem variable. We declare closureArray 4 times as an anonymous function. The anonymous function in turn declares the predefined write() function, which is passed parameters. Since write() is in closureArray() a closure is created??? During each iteration, theItem is reassigned its value. The four closures reference this value. Since they reference this same value and since this value is reassigned ultimately to the value of the fourth index position, tHe time we execute closureArray later on, all four closures output the same string. This is because all four closures are within the same scope "the same environment" and therefore are referencing the same local variable, which has changed.

I have a couple of problems with this example:

1) I thought a closure is a function that is returned - the inner function is not returned above.

2) theItem is not even a local variable of the parent function (closureArray) - I thought in order for a closure to work, the inner function only accesses the local variables of the outer function, but in this case the local variable is defined OUTSIDE of the parent function.

3) the "the four closures are sharing the same environment." The thing is even in the second example, they are sharing the same environment.

Second example:

// A correct use of closures within loops
var myArray = [ā€œAppleā€, ā€œCarā€, ā€œTreeā€, ā€œCastleā€];
var closureArray = new Array();

[code]....

Here we iterate over the length of myArray (4 times), assigning the index of myArray to theItem variable. We also return a function reference to the closureArray during each iteration (closureArray[i]), where i is index number so we assign 4 functon references. So when we iterate through myArray, we immediatelly call the writeItem() fucntion passing an argument of theItem at its current value. This returns a child anonymous function and when that child function is called, it will execute a block that calls the predefined write() method. We assign that returned anonymous function to the variable closureArray. Hence, closureArray holds a reference to that anonymous function. So closureArray during each iteration holds a reference to the anonymous function and we later call closureArray, which in turn calls the anonymous function, therefore calling the predefined write() function to output the local variable of the parent function. This outputs each distinct index of myArray.

This is because since we created the closure, when we call writeItem, passing theItem argument, since theItem is a local variable of the parent function of the closure, it is never destroyed when we later call closureArray (the reference to the child anonymous function)? Yet weren't we using a closure in the first example as well? So whey wasn't those variables preserved?

I don't think it has anything to do with assigning a returned anonymous function to closureArray. Even though an anonymous function creates a new memory position in the javascript engine, therefore not overwriting the other function references we create during the iteration, it's still referring to a local variable declared outside the reference. So if it's about the closure retaining value of parent's local variable even after exiting the parent function allowing for the current indexes to be preserved, then why did the closure in the first example fail to retain each index?

View 7 Replies View Related

Relative/absolute Positioning

Jul 23, 2005

I am trying to create a menu system.

The mainmenu is a table
<table><tr><td>menu1</td><td>menu2</td></tr></table>

No I try insert the submenu so that it becomes relative to the main menu
item. For menu1 the relevant code then becomes:

<td style="position:relative;">menu1<div style="position:absolute; top:20;
left:0;">
<a href=x.htm>option1</a><br>
<a href=y.htm>option2</a>
</div></td>

This works fine in IE: the div is positioned relative to the td of menu1.
However, in Mozilla it doesn't work. The div becomes relative to the top of
the page.

What am I doing wrong?

View 24 Replies View Related

Displaying All ID's In Relative Location...

Apr 3, 2007

I would like to display any item that has ID associated with it on the top-left corner of its physical location (20px up and 20px right) with yellow background and red foreground.

View 3 Replies View Related

The Relative Importance Of Web Development

May 24, 2007

If you follow the evolution of software development on Internet, you
may have the impression that every new development is Web based and
that the main areas of concern are whether you should develop new
application with Ruby on Rail or if you should choose Flash rather
than Ajax for the interface. However, if you ask developers, you may
find that the Web is not as ubiquitous in their work as you may think.

Even if 66% of the participants develop the majority of their new
applications with a browser as the interface, there is still a large
portion of developers that are working today for operating contexts
that are outside the Web world, like embedded software or Windows
applications. Code:

View 1 Replies View Related

Popups Relative To Resolution?

Jul 20, 2005

Does anyone know where I can get a script for a pop-up where I can control fixed positioning of a popup based on browser resolution?

two res's: 800 x 600 and 1024 x 768 ....

View 2 Replies View Related

JQuery :: Using .Get With A Relative Path URL?

Mar 21, 2011

I'm having an issue using .get and a callback. Basically, unlessI use a fully quantified path when I deploy my site the call doesn't work. When I'm developing on localhost, the site works fine. It's an ASP.NET MVC site. I'm fairly new to jQuery. If I replace the code with an absolute path, all seems fine. Obviously I'd rather use relative paths. I'd be grateful for any insight you could offer.

[Code]...

View 2 Replies View Related

Relative Path Of Image

Apr 16, 2007

1. I have some links that open with Javascript. The HTTP links work just fine, but I have one link that is supposed to open a picture in a new window. The picture is stored in the root/images folder. So it's supposed to be a relative path, but no matter what I do, I get an error page. (images/snailmail.jpg)

2. I have added a mouserollover funtion to change a small picture on the page. I am trying to add a second function to that function, to stop the scrollbar in the lower left corner as long as the mouse hovers over the picture. For the first picture, it works fine, but with the 2nd picture which allready has a mouseover function, I am not sure what to do.

View 3 Replies View Related

Relative Positioned Scrolling Div

May 23, 2005

I've wondering if anyone knows of a script where I can scroll a div down the page as the user scrolls down the page. You know, like those annoying ads do sometimes

I've googled for some, but the ones I've tried only work to varying degrees when I want the div positioned relatively. The reason I want it relatively positioned is that my site is centred, and fixed-width.

Basically, I need it to scroll up and down in a 'side bar' area, and the main problem I seem to be having: not scroll below my footer area.

View 6 Replies View Related

Preloading With Relative Paths

Dec 11, 2005

The two pages for preloading below seemed to preload images IF I used an absolute path but they don't preload the images if I just used relative paths like the ones below.

Give it a try. The two pages below using relative paths won't work. Then try changing the paths of the images in both pages to use absolute path(with http://) which will work.

But I want to use relative paths. What can be done? Other than inserting 1x1 size of the images I want to preload. Code:

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved