473,701 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a problem plugging document.locati on into a bookmarklet

greetings,
I'm working on a bookmarklet that needs to overwrite the current
document with a frameset where the src of one of the frames is the
current URL. What I've come up with works in Mozilla (Firefox 1.0pr).
But in IE6, though View Source shows that the new frameset is there
with the correct URL inserted, nothing displays. It's a white page.
Anyone see the problem/solution?

code:

javascript:void (docLocHref=doc ument.location. href);document. write('<framese t
rows="100%,*">< frame src="'+docLocHr ef+'"></frameset>');

thanks in advace,
kurt
Jul 23 '05 #1
1 1357
kurt <pe******@SPAMG UARDrocketmail. com> wrote in message news:<eq******* *************** **********@4ax. com>...
greetings,
I'm working on a bookmarklet that needs to overwrite the current
document with a frameset where the src of one of the frames is the
current URL.


I was able to get what you requested working in Netscape 7.2 too, but
not in IE 5.2.

I tried several approaches which are coded in frame2.html. I made a
button for each approach that I tried.

Maybe what I tried will be of some help to someone else figuring out
if this request is possible.

Robert

frames.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Frames Layout</title>
</head>
<frameset id="frameSetId " rows="50%,50%" border="0" frameborder="no " >
<frame src="frame1.htm l"
id="myframe1"
name="nameframe 1"
scrolling=yes>
<frame src="frame2.htm l"
id="myframe2"
name="nameframe 2"
scrolling=yes>
</frameset>
</html>
frame1.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Frame 1</title>

</head>

<body>
<p>This is frame 1.</p>

</body>
</html>
frame2.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Frame 2</title>
<script type="text/javascript">

function resizeFrame(per cent)
{

var node = top.document.ge tElementById("f rameSetId");
node.rows = percent;
}
function fullSize()
{

top.location.hr ef = "frame1.htm l";

}

</script>

</head>
<body>
<p>This is frame 2.</p>
<form>
<input type="button"
name="activate"
value="Both frames at 50%."
onclick="resize Frame('50%,50%' );">
<input type="button"
name="activate"
value="Enlarge upper frame to 75%."
onclick="resize Frame('75%,20%' );">
<input type="button"
name="activate"
value="Enlarge upper frame to 100%."
onclick="resize Frame('100%,0%' );">
<br>
<input type="button"
name="activate"
value="display only frame1.html"
onclick="fullSi ze();">

<br><br>
</form>
<a href="frame1.ht ml" target="_top">L ink only to frame1.html</a>
</body>
</html>
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1697
by: Jack3000 | last post by:
Is there anyway to view what is written when using document.write? When I view the source from the webbrowser, I don't see the code that is written after the browser performs the document.write action. Many thanks!
8
8236
by: Phil Powell | last post by:
if (document.location.href.indexOf('?') >= 0) document.location.href = document.location.href.substring(0, document.location.href.indexOf('?')); if (document.location.href.indexOf('#') >= 0) { document.location.href = document.location.href.substring(0, document.location.href.indexOf('#')) + '?' + newUrl; } else { document.location.href = document.location.href + '?' + newUrl; }
14
4119
by: Eli | last post by:
I've got a script that I'm trying to debug which uses document.write() to place HTML within a page. In both IE6 and Firefox when I view source, I see only the script itself and not any HTML as it's being written into the page. Is there a way that I can view what is being placed into the page, instead of, or in addition to the javascript code?
3
1959
by: weston | last post by:
Maybe I just need another pair of eyes or two, but it really seems as if document.getElementById is choking on me. This page: http://www.mortgageplans.com/mbc-network/enroll.html?EC=245 has an input form field coded like so: <input id="enrollCodeField" type="text" name="Code" value="" size="9"/> And I've got the following javascript, which tries to get a reference
1
1758
by: Robert Oschler | last post by:
In pre-Windows XP Internet Explorer, adding a bookmarklet for a user was really simple. All I add to do was create a link that executed addFavorite(). Internet Explorer under Windows XP won't allow that due to its new security measures. How can I make adding a bookmarklet convenient for my Windows XP IE users without having them to do surgery on their security preferences?
2
2686
by: Smugsboy | last post by:
Hi, Got a problem here. I'm trying to create a bookmarklet on IE6, that passes the outerHTML of the body element as a GET param my site. The problem is that for some page (ie mail.yahoo.com) the bookmarklet does not work while for other pages (simpler ones) it does work. Any idea ? Can it be something regarding size of GET param ? Thanks,
7
2760
by: Amir Michail | last post by:
Hi, I would like to add a submission bookmarklet to my app that takes the current selection and pastes it into the app's rich text editor while preserving formatting. It should work in at least Firefox & IE. Any pointers on how this could be done? Are there any examples that I can look at? Amir
3
992
by: Alex Bird | last post by:
Hi, Possibly I am searching for the wrong thing, but my googling has been futile. I want to get the contents of the browser (FF) location bar *before* I have navigated to that location. location.href / window.location have not been set at this point. Scenario: I want to be able to paste an address in, and hit a button to change certain parameters and navigate to the page. I can do this
0
8738
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9233
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9085
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8978
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7829
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5905
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4411
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3104
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.