IFRAMES & New Window

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
im-press
Beginner
Beginner
Posts: 9
Joined: Mon Sep 15, 2003 2:00 pm
Location: Hastings, England
Contact:

IFRAMES & New Window

Post by im-press »

I am now up and running using v5 as I have just spent 3 days moving my site from running with frames to using an IFRAME (http://www.im-press.co.uk).
1 question though does anybody know if you can open a "_new" window and force it to use the full screen?

Ian
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Personally, I hate it when sites change my browser window size. so it might be a good idea to open a new instance of a browser but using the default dimensions. You CAN max it out and there are plenty of scripts available for that. We could even come up with something if you get stuck.

As for the menu. What you need to do is declare a target within the aI() string. Like this:

Code: Select all

aI("text=Your Text;url=yourlink.htm;target=_new");
This will open the menu link in a new browser window

Regards
Andy
mfurf
Super Advanced
Super Advanced
Posts: 74
Joined: Tue Sep 23, 2003 12:30 am
Location: Purling NY
Contact:

From Frames to Iframe

Post by mfurf »

I have just begun experimenting with changing from frames to Iframe and have looked at Sample 11 and also the online explanation

The function is called openIframe and it's parameters are IFrameID and URL

function openIFrame(IFrameID, URL){
ifId=gmobj(IFrameID)
ifId.location.href=URL // Opera Bug Fix. ifId.src=URL
}

You must have an IFrame embeded in your HTML for the above function to work. You must also give the IFrame an id that will be it's reference in order to change the URL. The menuitem for changing the URL of your IFrame will need to look something like this:

aI("text=Open Google in IFrame;url=javascript:openIFrame('tempiframe,'http://www.google.com'")


Usiing URL=filename.html, could someone give me an example of the embedded HTML code for an Iframe followed by the menuitem that will pull filename.html into the Iframe. Thanx in advance. /mfurf
Oh Saratoga!
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Code: Select all

<iframe src="http://www.yahoo.com" width="700" height="400" id="myiframe" name="myiframe"></iframe>

aI("text=Open Filename in IFrame;url=javascript:openIFrame('myiframe','http://www.domain.com/filename.html');status=Open in iframe;");
Hows that?
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
mfurf
Super Advanced
Super Advanced
Posts: 74
Joined: Tue Sep 23, 2003 12:30 am
Location: Purling NY
Contact:

How's That?

Post by mfurf »

Hows that?
Superb. Much obliged Herg! While waiting for someone to reply I found where on Aug 19th you said
Secondly, you can target other iframes by using the target tag. Your aI tag would say url=www.google.com;target=myframe1; You dont need the javascript thing, I dont think.
so I tried it and it's working. I've almost got my site iframed on my hard drive.

So what advantage is the javascript thing over a simple target=iframe? Using the latter I find I don't even have to give the frame an ID.

/mfurf
Oh Saratoga!
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Excellent job mfurf...you are correct on the id thing. Glad you were able to find the answer before I even posted. But in regards to the id and javascript thing. Off the top of my head, I can see no real advantage to the javascript other than, if down the line you want to change the way the links open, you can just change the function. Or if you want something else to happen when someone clicks a link (like count clicks) then the JS is better. You caught on to the name/id thing good there. Its kinda weird, but if you want to refer to something using javascript, you NEED an ID. Thats just the way javascript can get a handle on objects in the page DOM (document object model). But when you are referring to objects through hyperlinks or in forms (like when you want to retrieve values from a form submission) the name is whats used... so you can target an object using the name since it has to do with the hyperlink. I think its kinda confusing at times, I wish they would just pick one over the other. So to cover my butt, I always give all objects that I will be accessing a name AND an ID and set them the same, then theres no question. ;)
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
mfurf
Super Advanced
Super Advanced
Posts: 74
Joined: Tue Sep 23, 2003 12:30 am
Location: Purling NY
Contact:

Post by mfurf »

Hergio:

I've been able to place two iframes on a page, position the main menu outside of both, and call a scrolling menu in one of the iframes. Which is the effect I had with the old frameset.

The iframes are positioned generally [not specifically] through use of the align and valign tags. Is there a parameter or tag to position iframes with precision, the way Andy has provided to position the menus?

I'm awed by your superior script knowledge. /mfurf

FYI, some wee spiders are out there harvesting our emails off this site. I have a way of knowing in that I sometimes create an email alias for a specific site which I did with this board. Today I got my first spam addressing me with that alias. It had to come from here. I'll bet Andy could come up with a bit of Java that would scramble the code the spider looks at while not scrambling it to the viewer. /mf
Oh Saratoga!
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Dont have time to look it up definetly right now, but I believe you can set the style of the iframe to have position="absolute" and then you can specify top and left coordinates as well as height and width (like you know you can). I can check for sure later, but try messing with the style of the iframe to do that.
I'm awed by your superior script knowledge. /mfurf
Aww shucks! :oops: You dont have to be so kind.

If you want to remove your email from being viewed on here, go to your profile and check NO for 'always show my email'. Then only admin can view your email and send you things and no spiders see your stuff. I guess we could hack into the phpBB code and scramble emails, but I think there are alot places in the code emails are displayed...I will look for a hack that maybe someone has already created for obfuscating emails. ;)
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
mfurf
Super Advanced
Super Advanced
Posts: 74
Joined: Tue Sep 23, 2003 12:30 am
Location: Purling NY
Contact:

Post by mfurf »

Thanks. I will mess with the style and see what I can find.

I "unviewed" my email as you suggest but I'm not sure that will fool a spider. unless the checkoff somehow removes the email address from the board's code and not just hides it from view.

I know spiders hunt for "@ " signs. And somewhere I have the javascript code for breaking up the address and reassembling it for the viewer -- a simple concatenation so that it never shows as you@yourISP.com etc. But the spiders get more and more sophisticated and can be programmed to read the code, so that one has to employ more variables, use decimal or hex code for the "@" etc. One must play a continual game of three card monty with the spiders.

/mfurf
Oh Saratoga!
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Mfurf, I quick viewed your preferences and saw that "Always show my e-mail address:" was still set to YES, I changed it to NO for you. I then created a dummy account with basic privedges and logged in and I was unable to see your email address. So I would bet that even Guests (which spiders might be using) would not be able to view it either. There ya go!
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
mfurf
Super Advanced
Super Advanced
Posts: 74
Joined: Tue Sep 23, 2003 12:30 am
Location: Purling NY
Contact:

Post by mfurf »

Thanks Dave. Dunno, I could have sworn I had changed it, even exited and came in again, but I was probably looking at the cached page. /mfurf
Oh Saratoga!
Post Reply