Solved

specific div display onclick

Posted on 2011-03-17
4
132 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
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 add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
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…

726 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