2 Replies - 5265 Views - Last Post: 12 January 2012 - 10:01 AM

#1 bornecw   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 10-January 12

Transition with window.location

Posted 10 January 2012 - 02:44 PM

Hello All,
This is probably something easy, but I seem to be getting stuck here. The transitions are not firing off, I suspect because I am using window.location.

I have a button:
<a href="index.html" data-role="button" id="btnSave" data-transition="slide">Calculate</a>

And my Javascript Function:
$(document).ready(function() {
      window.scrollTo(0, 1);
      $("#btnSave").click(function() {
            var result =(3.14285714*(($('#fRadius').val())*($('#fRadius').val())))*($('#fHeight').val());
             window.location = "gatherInfo.html?" + result;
 });
});


Is This A Good Question/Topic? 0
  • +

Replies To: Transition with window.location

#2 Jstall   User is offline

  • Lurker
  • member icon

Reputation: 434
  • View blog
  • Posts: 1,042
  • Joined: 08-March 09

Re: Transition with window.location

Posted 12 January 2012 - 08:08 AM

Hi,

Just a few things. Are you sure that your click handler is firing?


Are you sure that there is not an error with the line:
var result =(3.14285714*(($('#fRadius').val())*($('#fRadius').val())))*($('#fHeight').val());


?
Have you tried to view the result variable(just put it in a console.log or an alert) to ensure that it is what you expect it to be?

Your redirect line looks like it should work, that's why I am asking. Putting a window.redirect call inside a click handler should not cause a problem in and of itself.
Was This Post Helpful? 0
  • +
  • -

#3 bornecw   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 10-January 12

Re: Transition with window.location

Posted 12 January 2012 - 10:01 AM

Thanks for the reply. The code is working properly, and it is changing the page. The problem is that the transition is not firing. Is there a way to call the transition when using window.location?

View PostJstall, on 12 January 2012 - 08:08 AM, said:

Hi,

Just a few things. Are you sure that your click handler is firing?


Are you sure that there is not an error with the line:
var result =(3.14285714*(($('#fRadius').val())*($('#fRadius').val())))*($('#fHeight').val());


?
Have you tried to view the result variable(just put it in a console.log or an alert) to ensure that it is what you expect it to be?

Your redirect line looks like it should work, that's why I am asking. Putting a window.redirect call inside a click handler should not cause a problem in and of itself.

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1