/    Sign up×
Community /Pin to ProfileBookmark

Hello,

I have iframe with src attribut, to load an external document. ? If i add onmouseover with window.status=’text’ to my iframe, it has no effect, when I actually point to a link from that document. :rolleyes:

Some ideas? ?

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@mishkinSep 01.2006 — try this: <div onMouseOver="window.status='text'"><iframe></iframe></div>
Copy linkTweet thisAlerts:
@s5jzauthorSep 01.2006 — No success. I think I have to reffer to that external document link somehow and maybe not by iframe onmouseover. I tried frames['iframename'].document.links[0].onmouseover but it's a no go. :rolleyes:
Copy linkTweet thisAlerts:
@mishkinSep 01.2006 — it may work if you reference a jscript function that changes the window status instead of doing it directly in the element.
Copy linkTweet thisAlerts:
@s5jzauthorSep 01.2006 — i did manage to change window status but it appears that when I actually point to a link it overrides the changed status (it shows when I stop pointing to a link) :rolleyes:
Copy linkTweet thisAlerts:
@mishkinSep 01.2006 — That's totally normal, hovering the cursor over a link always shows the link's URL in the status bar... I figure if you take your window.status function and place OnmouseOver in the actual <a href> tags you should avoid the change when you hover over the link.
Copy linkTweet thisAlerts:
@s5jzauthorSep 01.2006 — I would, but its an external document witch I can't change...
Copy linkTweet thisAlerts:
@mishkinSep 01.2006 — that's not completely true...

you can actually edit the code of another site appearing in a frame of your site. (sort of)

I haven't tested this, but it may work.

check it out:

<iframe id="myFrame"></iframe>

Then do this:


theFrame = document.getElementById("myFrame");

if(theFrame.contentDocument)

{

displayedPage = theFrame.contentDocument;

linksFromPage = displayedPage.getElementsByTagName("a")

}

And that will give you an array of every link on the person's page. You can then run the array through a for loop that does this:

linksFromPage[i].setAttribute("onMouseOver","window.status='whatever'")



This will allow you control the actual code in someone else's page when being viewed through your iframe.
×

Success!

Help @s5jz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...