[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

specific div display onclick

Posted on 2011-03-17
4
Medium Priority
?
136 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 1500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

650 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