LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Redirect Button to new Web Page

Solved!
Go to solution

I am making a top level web page and would like a button on this page to load up another web page. 

I'm guessing a simple "redirect" button where I can specify the "GSwitch.html"

 

So I tried using a Javascript example

So the .js file has the following:

<script src="redirect.js"></script>

 

And the jlsi looks like this

DeOdderKeith_0-1603824998102.png

But it doesn't do anything...meaning it doesn't seem to execute the JavaScript

 

Any suggestions?

 

KM

0 Kudos
Message 1 of 4
(2,153 Views)

Hi KM,

 

There is an example URL handling library attached to the forum post LabVIEW NXG WebVI's accessing the query string in its URL which includes a Set Window Location VI that can be used to navigate the browser window to a new location. It may help address the redirect use case or be a useful example to build on.


Milan
0 Kudos
Message 2 of 4
(2,125 Views)

I would like to deploy a website with multiple pages and be able to move from page to page depending on selections.

What is the best way to achieve this?

 

 

KM

0 Kudos
Message 3 of 4
(2,075 Views)
Solution
Accepted by topic author DeOdderKeith

Hi KM.

 

The Multiple Top-Level WebVIs example shows how to make a Web Application with multiple pages. The example uses the hyperlink control to link between the pages which requires the user to click the link to move between pages.

 

You can programmatically move between pages using the URL.gcomp library in the example I mentioned in the previous post. The library has a Set Window Location VI which you can assign a relative or absolute URL. The following example shows the Set Window Location VI being called in response to a button click:

 

SetWindowLocation2.gif

 


Milan
0 Kudos
Message 4 of 4
(2,061 Views)