Solved

Pass game id into 5 Iframe pages is it possible

Posted on 2013-12-03
7
314 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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)

688 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