Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on some java script!!

Status
Not open for further replies.

mannion

IS-IT--Management
Jun 24, 2002
73
0
0
GB
Hi

Im using a java script menu on my website. Im using frames on my site and the menu is located in the left frame. when I click on one of the icons in the menu it opens the frame in the left frame, what code should I enter to get it to open in the middle frame?

here's an example of my code!

"Folder 1",
"interior.gif","My BMs Interior","../interior.html","window",

[afro]

James Mannion
 

here's an example of my code!

"Folder 1",
"interior.gif","My BMs Interior","../interior.html","window",

James,

Whatever way you look at it, what you've posted is not valid code. If I put tried to run that in any browser, it would simply error and do nothing.

Unfortunately, we would need to see actual, proper code to be able to tell with any degree of accuracy how to help you with this one. Telling us what menu system you are using would also be a big help (assuming it is a pre-built one, of course).

Having said that, as a general rule, you would need to target the main frame... And if you're using standard "A" tags with an "HREF" for your menu links, adding a "TARGET" attribute with the value being the name of your main frame should do the trick.

Hope this helps,
Dan
 
Hi Dan,

I got the strip of code from dynamicdrives.com, And as you can see im very new to Java, although what I have learned so far I have enjoyed.

Now to put all the code in will take to long as the menu has two source .js files, im editing one .js file to change the link, to open my pages, and it is working but only on the in the frame that the menu is. I wanting to open it in a different frame, I know from using html that to do things like this you need to set a target, but i dont know how you would do this with java!

looking at the code it has "window" at the end of this, could I also enter "target" to the right frame and if so what code would I write in!

thanks

James Mannion
 

Unfortunately, Dynamic Drive have many menu systems available on their site, so you really would need to be more specific about which one you are using, or post some code, or a link to the code. I cannot help you further with the information you have provided to date, although someone else may be able to.

Incidentally, Java and JavaScript are two totally different languages.

Hope this helps,
Dan
 
Hi Dan

On the dynamic drive website I used the outlookbar 1 from the menu and navigation link!

Sorry I thought I typed this in, got carried away in my head and missed this important info out!

Thanks so much for your help so far! Also do you know any good books on the basics of Javascript? I think im in great need of this!

Thanks

James [afro]
 
If you look in the file "folders.js", line 30, you'll see an example of how to target different frames.

In fact, the demo download uses frames by default - the target frame in that case is called "MAIN".

Hope this helps,
Dan
 
Thanks Dan,

It took a little why but I suddenly worked out where I was going wrong, due to my lack of knowledge I actually made a big deal out of this!!

It turns out I got the name of the frame wrong hence why the parent.MAIN wasn't working which lead me into using window and getting myself in a pickle. I should have been using this parent.MAINFRAME, found this out after editing the frameset in notepad!

I feel stupid now! I think im going to have to get a book to learn some basic java before trying this again!
[sadeyes]

thanks!
[afro]
James
 
I think im going to have to get a book to learn some basic java before trying this again!

As I said before - Java and JavaScript are two very different languages. If you go and buy a Java book, you will not be getting what you expect.

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top