Solved

specific div display onclick

Posted on 2011-03-17
4
130 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
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.…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

772 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