Solved

Pass game id into 5 Iframe pages is it possible

Posted on 2013-12-03
7
270 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
  • 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 42

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 42

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn how to dynamically set the form action using jQuery.
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)

744 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