Extending Functionality in Vuforia Studio with Code > Using JavaScript in Vuforia Studio > Open an Experience from within Another Experience
  
Open an Experience from within Another Experience
You can open an experience from within another experience using one of the following ways.
Use a Hyperlink Widget
1. Open an existing published experience.
2. Select Share Experience from the Share menu.
3. Click Copy under the Experience URL.
4. Navigate back to the project page, and create a new 2D or AR project.
5. Drag and drop a Hyperlink widget onto the 2D canvas.
6. Paste the URL that you copied from the existing published experience into the URL field, and enter the text to display for the link in the Text field.
7. Click Publish.
8. Now, when you click the hyperlink, the other experience opens.
Use a Button Widget and JavaScript
1. Open an existing published experience.
2. Select Share Experience from the Share menu.
3. Click Copy under Experience URL.
4. Navigate back to the project page, and create a new 2D or AR project.
5. Next, click Home.js and enter the following JavaScript:
$scope.loadDeeplinkedExperience = function () {
window.location="<Copied Experience Link>";
}
Replace <Copied Experience Link> with the experience URL that you copied from the first experience. For example:
$scope.loadDeeplinkedExperience = function () {
window.location="vuforiaview://ptc.com/command/view-experience?url=https%3A%2F%2Fmy-es-url.test.thingworx.io%2FExperienceService%2Fcontent%2Fprojects%2Fpumps%2Findex.html%3FexpIndex%3D0%23%2FHome";
}
6. Navigate to the 2D canvas and drag and drop a Button widget onto the center panel.
7. Enter the name of the button in the Text field. For this example, we’ll name the button Pump.
8. Click the JS button next to the Click event, and enter the following:
loadDeeplinkedExperience();
9. Click Publish.
10. Now, when you click the Pump button, the first experience opens.