Solved

specific div display onclick

Posted on 2011-03-17
4
129 Views
Last Modified: 2012-05-11
I have the page called 'Test_Demo' that has two scripts, here are those scripts:

<script src="http://l.yimg.com/a/i/us/pps/mapbadge_1.3.js">{"pipe_id":"461b27bd06c88a959a79cadc5ef7d9ae","_btype":"map","pipe_params":{"rssurl":"http:\/\/sports.espn.go.com\/espn\/rss\/news"},"width":"740","height":"510"}</script>

<script src="http://l.yimg.com/a/i/us/pps/listbadge_1.4.js">{"pipe_id":"461b27bd06c88a959a79cadc5ef7d9ae","_btype":"list","pipe_params":{"rssurl":"http:\/\/sports.espn.go.com\/espn\/rss\/news"},"width":"740","height":"510"}</script>

Open in new window


I have two buttons on another page called 'Main', here it the code for those buttons:
<div class="list" style="left:530px; top:651px;" onClick="myIframe.location.href='scripts/Test_Demo.php';" title="List View"></div>

<div class="map" style="left:627px; top:651px;" onClick="myIframe.location.href='scripts/Test_Demo.php';" title="Map View"></div>

Open in new window


 I want to link one button from Main to one script from Test_Demo and the other button to the other script.

Is there a way I can do this with both scripts being on the same page, or do I need to separate out each script to it's own page?
0
Comment
Question by:MsKrissy
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:nbove
ID: 35159867
You could pass parameters to your Test_Demo page in the query string.  The scripts could then be modified to inspect the query string and execute conditionally.
0
 

Author Comment

by:MsKrissy
ID: 35160098
By doing it that way do I save loading time rather then just having each script as its own page.  Then call that page?

I ask only because I'm still confused.
0
 
LVL 7

Accepted Solution

by:
nbove earned 500 total points
ID: 35160184
Ultimately, it doesn't really matter if you split the scripts out into separate pages or leave them on the same page performance wise.  I would say do what makes the code look more clean and easy to manage.  If it is confusing for you to leave both scripts on the same page and execute them conditionally, then split them out into their own pages.  If it makes more sense for you to leave all of your scripts on one page and inspect a parameter to determine the appropriate script to execute, then go that route.  It really is just personal preference.
0
 

Author Closing Comment

by:MsKrissy
ID: 35222961
I really wasn't given a solution, I was just give options on how to attack the issue.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Login area of a page 4 32
Bootstrap more than 12 columns in row 3 37
simplest php form 3 59
Put shading on half of picture 8 23
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now