I am trying to make scrollIntoView() work (with selected text in a div), but I am having no luck. I have put up a little demo that shows the problem. It's at:
http://www.wiseware.com/selectTest
FF is my main concern. Of course, I would be happy to find a solution that works in IE, too...
I am working on an app that uses http requests (to local files) to fill a div. The files are large, but not huge (the largest is a little less than 1000KB) but even though there is no error during the request, I find that files larger than ~100kb do not fully load. When I load one of the...
I found a little image preload utility that works correctly only when the page is accessed remotely. The problem is with its error handling function. If one of the images to be preloaded is missing (and in the example I have posted, the image rockwell.jpg is not on the server), it should show...
How can I pass a copy of an image stored in an array to a scaling function? I have the scaling function, and it works fine, but if I pass the image to it like this:
scaleThis(imageArray[x])
the original image (stored in the array) gets scaled. This is not what I want, I only want to scale a...
1. How do I include a line feed in a string passed to document.createTextNode()? I have tried \n and <br />, but the former is simply swallowed with no effect, and the latter shows literally in the parent div.
2. I have borrowed and implemented a preload image routine that works fine online...
What event occurs when the user changes the text size on a page via the Browser's Ctrl++ key combination? How would I listen for this event and respond to it?
Thanks,
JAS
What is the difference between window.onload and the onload event in the body tag? IE7 seems to treat them differently than FF2, Safari 3 and Opera 9 (Win XP PRO SP2). Is there a reason to prefer one over the other? Does it make a difference if window.onload appears in an imported script...
I have been trying to study some code I found at:
http://www.webreference.com/programming/javascript/gr/column3/
for preloading images. The demo site described on the page above no longer exists, so I had to build my own from the article. I did that, and you can see it at...
I have posted an example page at:
http://www.wiseware.com/test
that shows a problem with the way IE7 handles (or rather, refuses to handle) styles applied to dynamically created elements. The page loads perfectly in FF2, Safari 3 and Opera 9, but I cannot find anyway to get IE7 to do it right...
The function below works fine in FF, IE and Opera. But it does not work in Safari. Is there a work-around for this problem?
thanks,
JAS
function loadStyles() {
var oLink = document.createElement('link')
oLink.href = './CSS/myStyles.css';
oLink.rel = 'stylesheet';
oLink.type =...
I create several input elements like using this function (with a different iID argument each time):
function createResponseItem(iID) {
var newInput = document.createElement('input');
newInput.setAttribute('id','response-' + iID);
newInput.setAttribute('type','radio')...
I need to build a string like this:
str = "1. some other text";
This string will become the content of a new textnode (of a <p> element), but when I try the above, I get the literal characters rather than a non-breaking space.
What's the right way to do this?
Thanks,
James
I want to test various regexp against a specific piece of text, so I wrote a function that creates a new regexp from user input. It works fine, except that if I try to replace a given string with a new line (i.e. "\n"), I get the backslash and the "n" instead of a new line. My function looks...
I want to get the text currently selected in a document being edited in Google Docs. The following does not do the job (though it works fine in every other context where I have tried it):
var thisText=window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection()...
I asked a question the other day about using javascript to do TCP, but nobody responded. What I want to do is simple enough: I just want to use javascript to send a request to the server at dict.org. Is that possible?
Thanks,
JAS
A newbie question to be sure: Can I use javascript to make a TCP call? If so, can you point me to any help, tutorial or the like for doing this sort of thing?
Thanks.
Does the function called by an onclick event know the id of the dom element that was clicked?
For instance, given:
<a href="#" id="DUMMY" onclick="myProc()">Dummy</a>
does myProc know it was called by DUMMY, and if it does, how do I refer to DUMMY within the body of myProc?
Thanks,
JAS
My HTTPRequest always returns status = 0 (which is not even listed on the WC3 page of possible responses).
I am retrieving a simple text file, and the responseText does contain the text I want. So my function works even though the status is 0.
What does status = 0 mean? Is this a real...
I have a div with a fixed height and overflow: auto. I set the content of this div via a (prototype) ajax call. Sometimes the content is long enough to force a vertical scroll bar, sometimes it isn't. If I load content A, and it is long enough to force the scroll bar, and then I use the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.