View Full Version : JS & Iframes 2 Questions

09-25-2008, 07:10 PM
#1. Problem
I have the highlighter roller script from here that I modified the <div> tag on to center the text array's and remove the highlighting. It works perfectly both locally and on line, inside the iframe with FF, Opera etc. but NOT with IE. IE gives an error of "beginclip" not defined when I display the script inside the iframe. (The script is in a seperate html file that loads in the iframe.) When I try the script stand alone in the html file locally or on line it works fine with IE but NOT inside the iframe !

This is the script:http://www.javascriptkit.com/script/cut57.shtml

Here is how I modified the <div> tag after a suggestion on these boards.

<div style="position:relative;left:0px;top:0px;">
<p id="highlighter" style="width: 100%;text-align: center;position:absolute;left:0;top:0;font-size:11px;font-family:arial;font-weight:bold;background-color:white;clip:rect(0px 0px auto 0px)"></p>

#2 Problem.

I have an iframe with a link to an anchor on the same page further down as the iframe. When you click it, the entire page reloads THEN jumps to the anchor. How can I get the link to simply jump to the anchor without reloading ? (<a href="index.html#DISASTER">) Is there a js way to do it ? Using a "target" tag does not work.

Thanks for all the great help and scripts btw.

09-28-2008, 12:32 AM
Solved the problem with IE
The script had a line:


I deleted the (BeginClip) part and it's fine in IE, FF, Opera iframes or not, on server or local. <<<<<<<<<<<<<is a puzzlement

I still cannot get a link referencing an anchor OUTSIDE the iframe on the same page to work without reloading the parent page first. Weird.

<a href="index.html#DISASTER"> so if anyone has a JS code that will do this
I would be grateful.