Solved

Pass game id into 5 Iframe pages is it possible

Posted on 2013-12-03
7
309 Views
Last Modified: 2013-12-03
I can pass a game id into a page and that page displays perfectly now  I was wondering if I could pass that game id into a IFrame page with 5 I frames that need that game id

This is Web page with 5 IFRAME PAGES
http://dev.sportsnetwork.com/aspdata/nba2/NbaGamecast1.html?gameID=18434 


BUT in the Iframe IF I  hardcode a value like

<iframe width='100%' height='400' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/Court4.html?gameID=18434'> </iframe> IT WORKS .


Can I create or use a variable that will work outside the javascript tags. Thanks EE
0
Comment
Question by:powerztom
[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
  • 3
  • 2
  • 2
7 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39692926
You should consider Iframe like new browser tab or popup. An Iframe is like a page inside a page. The url in the browser bar is the value of the SRC attribute.
0
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 39692948
Hey Tom,

Having problems loading your page so can't see what you've done. But here's some idea of what I'd do. The more you need to rely on dynamic data the more reason there is to switch to using a server-side scripting language such as PHP or ASP. It make sense to start using that earlier rather than later, so you don't need to change everything a few months down the line.

If you were using PHP for example (my scripting language of choice), then it would be simple. First you'd grab the gameID from the query string (the bit in the URL after the question mark):

<?php $gameID = $_GET['gameID']; ?>

Open in new window

Then for each iFrame, you'd just echo (output) the $gameID variable wherever you need it:

<iframe width='100%' height='400' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/Court4.html?gameID=<?php echo $gameID ?>'> </iframe>

<iframe width='100%' height='400' scrolling='no' frameborder='no' src='someOtherPage.html?gameID=<?php echo $gameID ?>'> </iframe>

<iframe width='100%' height='400' scrolling='no' frameborder='no' src='anotherPage.html?gameID=<?php echo $gameID ?>'> </iframe>

Open in new window

Pretty much every application on the web these days is built using Server-Side scripting, so sooner or later you will need to embrace it :)
0
 

Author Comment

by:powerztom
ID: 39693034
Chris we don't have any php framework installed Is that what you need to use php. We do have .net 2.0 and I can program in asp.net but for this case how do I do what you just did in PHP but do it in VB.NET OR C#. Preferably VB.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 39693075
You'd do it in ASP instead of PHP and I have no idea how to use ASP - sorry :(

Installing PHP on a windows server is straight forward enough though, so that may be an option.
0
 

Author Closing Comment

by:powerztom
ID: 39693141
Straightforward advice. Thanks Bro
0
 

Author Comment

by:powerztom
ID: 39693269
I wrote

 Sub Page_Load(Source As Object, E As EventArgs)

   Dim ID As String
   

   

            ID = Request.QueryString("gameID")
   END SUB

<iframe width='100%' height='175' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/Nbastart1.html? & ID & '></iframe>


But it's not & or <% tried both. Please Help
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39693347
<iframe width='100%' height='175' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/Nbastart1.html?gameID=<%= ID %>'></iframe>

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sort Multi-dimensional array 6 40
CSS (jquiry mobile) question 3 32
JSON help 8 42
jquery autocomplete forcing the user to select an item from the list 7 59
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

736 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