• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Richard 3 · Jan 08, 2012 at 06:39 AM · wwwhtmlwebsiteframes

Load a HTML Page into a frame in a browser

Hi.

I have a web page made up of two frames, Unity project in one frame and html pages in the other. I would like my Unity project to load HTML pages into the second frame. This will stop my Unity project reloading with every page load.

How would I go about this?

Thanks in advance.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Julien-Lynge · Jan 08, 2012 at 07:31 PM

Richard,

You can make javascript calls from within Unity and use these to load a webpage in the other frame using the HTML DOM. There are plenty of examples of using JS to load a page in a frame, for instance this one. On the Unity side, here's a page explaining both the ExternalCall and ExternalEval (I suggest you check out the script reference for both).

Good luck.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Richard 3 · Jan 09, 2012 at 08:04 PM 0
Share

Thanks NOAA_Julien , I ended up doing this. Works well.

function On$$anonymous$$ouseUp () {

var tJSString = "window.open('page2.html','mainFrame')";

Application.ExternalEval(tJSString);

}

"page2.html" is the URL and "mainFrame" is my frame name.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Add game to my website? 2 Answers

"failed to download data file" When I put my game on 000webhost 2 Answers

Display a website page 2 Answers

Split string data 0 Answers

Webplayer telling me to install but its already been installed? 3 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges