Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6135045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:25:54+00:00 2026-05-23T17:25:54+00:00

What I am want to do is really simple. I have an gwt app

  • 0

What I am want to do is really simple. I have an gwt app with just one button, everytime I click the button, I want my window.location.hash changed.

here is what I have so far


private native void setLocationHash() /*-{
   var hash = window.location.hash;
   window.location.hash = hash+1;
}-*/;

So every time my button click event fires, that JSNI function would be called.
Suppose before button click, my url is
http://127.0.0.1:8888/GwtSampleApp.html?gwt.codesvr=127.0.0.1:9996#1
after clicking the button, my url SHALL be
http://127.0.0.1:8888/GwtSampleApp.html?gwt.codesvr=127.0.0.1:9996#2

But so far, this is not working 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:25:54+00:00Added an answer on May 23, 2026 at 5:25 pm

    You don’t need to use JSNI as GWT has the History class for your purpose.

    History.newItem("you_hash_here");
    

    see Documentation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It's really simple, I just want one screen. Wow, that [shiny thing] must have
I have a really simple Rails app. Basically an article with comments. I want
I have a really simple question, but I just want to know what the
I have a really simple blog application and I want to add a really
I have a really simple table with two rows and two columns. I want
Really simple question: From within GWT I want to forward the user away from
Really simple but just not getting it. I want to reference a view by
I have just encountered very strange problem - my GWT app hosted on Google
I have a really simple Javascript BBCode Parser for client-side live preview (don't want
What I want to achieve is really simple. I have a Select statement where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.