locked
Button Hyperlink In JavaScript

    Question

  • Hello Everyone!

    I have been searching the forums here for the past two days and i can't find exactly what i'm looking for.

    Im currently working on a project in Visual Studio Express 2012 for Windows 8 using JavaScript. When you first start up the app, there is a hub page with three buttons. Im trying to use the buttons as hyperlinks to a different pages within the app.

    So say the first button says "create a account", once you click this button, it takes you to a page where you can create your account and submit your information.

    So my question is, "How do i get the "Create A Account" button to navigate the user to the next page?"

    Also i have a normal hyperlink that links to a separate page within the app. When i go into Debug mode to test it, the link goes to a blank white page with no back button in the top left corner or my page content.

    If anyone can help me resolve these problems, i will be extremely grateful. Thanks in Advance.

    Thursday, September 26, 2013 11:52 PM

Answers

  • Hi Lord Tyson,

    Let's separate your question for a better understanding, if my understanding is not correct, update me please.

    1, How do i get the "Create A Account" button to navigate the user to the next page?

    Are you trying to find this one? navigate function will help you navigating to another page within WinJS.

    2, When i go into Debug mode to test it, the link goes to a blank white page with no back button in the top left corner or my page content.

    Here if you do not have any navigation history, the back button should not be displayed, otherwise where to navigate? You could see the sample code from MSDN:http://code.msdn.microsoft.com/windowsapps/Navigation-and-navigation-b8ec9a06

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, September 27, 2013 8:31 AM
    Moderator

All replies

  • Hi Lord Tyson,

    Let's separate your question for a better understanding, if my understanding is not correct, update me please.

    1, How do i get the "Create A Account" button to navigate the user to the next page?

    Are you trying to find this one? navigate function will help you navigating to another page within WinJS.

    2, When i go into Debug mode to test it, the link goes to a blank white page with no back button in the top left corner or my page content.

    Here if you do not have any navigation history, the back button should not be displayed, otherwise where to navigate? You could see the sample code from MSDN:http://code.msdn.microsoft.com/windowsapps/Navigation-and-navigation-b8ec9a06

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, September 27, 2013 8:31 AM
    Moderator
  • Hello James and thanks for the reply.

    For question 1, that's sorta what i'm looking for. Im sorta new to Visual Studio and Windows 8 app creation so i honestly wouldn't know where to put this code let alone how to type it up. Heres and example how how i have my current code set up.

    So say my code for the button on home.html looks like this...

    <button id="createaccountButton">Create A Account</button>

    When i go to Debug mode to test, i move my mouse cursor over the button, it gets highlighted and when i click nothing happens. Im trying to get it to navigate to the next page, Now the code that i need for this to work properly, would that be on my home.js file, or the default navigator.js file?

    For question 2, Ok what you said makes total sense. But what i dont understand is how can i have navigation history when the link just goes to a blank white page? I followed a tutorial on how to properly create a hyperlink and link it to a separate page. Everything was copied but i got a white page. Im not sure if i did something wrong or if its my computer or a bug in Visual Studio.

    Sorry if im not coming across clear in my explanations, but much thanks goes out to you for your help!

    Saturday, September 28, 2013 1:56 AM
  • Hi Lord Tyson,

    I suggest you put the code on home.js, because this file is a JavaScript collection for home.html page.

    And click the link goes to a blank page? that's really strange! Could you share your code with us via skydrive or create a demo for a further analysis?

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 30, 2013 1:15 AM
    Moderator
  • I will gladly create a demo! Thank you so much! Ill post it here in a bit. 
    Wednesday, October 2, 2013 5:23 AM
  • Hi Lord Tyson,

    Any update? I will close this thread, but you could always post code and I will continue help you with your issue.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, October 8, 2013 6:00 AM
    Moderator