mardi 19 août 2014

Post to a URL from Dojo / Javascript Bug


Vote count:

0




I am relatively new to web development and I'm running into a bug.


In my javascript / dojo code, I have a link which opens a new window and does a post. It might make more sense with my code: (btw I'm using DOJO / Javascript and self is a content pane)



(in onClick method for the link)
self.openPost('POST', the-url-was-here, {p_username:username}, '_blank');


The URL I am posting to is a tool which takes the username that is passed in and displays a bunch of information about the user.


It behaves pretty much like a window.open(_) except it does a post to open to that URL.


It works almost exactly how I want, BUT there's a bug that happens the first time a user clicks the link on my page after logging in. Let's say the person enters a username for User A. The first time they click the link, it just goes to the tool's "search" page - as if there was no post to that URL and just went straight to the URL. But then if I click that same exact link a second time, the post will happen and the information for User A will show up. Then if I enter a different username (user B) and click the link, it will open a new window and correctly show User B's info.


So it only doesn't work the very first time the user logs in and tries to look up a user.


Any ideas on why this might be happening?


Thanks in advance!



asked 28 secs ago

Mei

107






Post to a URL from Dojo / Javascript Bug

Aucun commentaire:

Enregistrer un commentaire