Welcome Guest, Not a member yet? Register   Sign In
Javascript popup window loads on 2nd attempt
#1

[eluser]mikertjones[/eluser]
Hello all

This follows on from a post I made a few days ago. Unfortunately the problem persists but I can't tell whether it's a Codeigniter problem or something else.

The application loads a user control panel after a successful username/password log in.

A JQuery function attaches click events to each of the links on the control panel page. Each link has a 'controller' attribute. The JQuery function reads the controller attribute and builds a url string - <domain>/index.php/<controller>. The click event then opens a new popup window with the document returned by the controller.

My users find that a click on a link does not open the window. If they click the browser stop button and then click on the link again, the window opens as it should.

Can anybody tell me what happens in the process that could cause this to work like this?

The users have no trouble with opening windows on the first click if they access the app from outside of their organisation network. What possible network settings would cause the window to fail on the first click and then succeed on the second click?

I suspect that it is not a Codeigniter issue but I am scratching my head to understand this behaviour.

Any help would be great and thank you in advance.

Mike Jones
#2

[eluser]jdav3579[/eluser]
Hi,
I have had problems similar to this in the past. Without seeing the code. I might suggest you take a look at the site in both Firefox and IE.
The problems I have had in the past are that the Javascript to load the window takes an age to load. It is still loading even when the page is displayed. So when the user clicks on the link the javascript doesnt activate as the code is not loaded.

A solution may be to use the Google CDN. Then if a user has been on any site that has JQuery off the CDN it is already stored in their browser. This then means it doesnt have to load it when it comes to your site.
I will have a look at other solutions and update this post for you.

Cheers
John
#3

[eluser]mikertjones[/eluser]
Thanks for your reply John

That does bear investigation but I think that the problem is evident even if a user has been logged on for a sufficient time to allow the page to finish loading and for the jQuery document.ready function to have done its bit. I'll get a user to test / confirm that for me.

It also doesn't explain why it works first time if they use it from outside of their network unless their network is sooooooo slow that loading page elements (including the jQuery library) takes a real long time.

Anyway, I appreciate your thoughts. I'll post the answer to my question from the users.

Mike
#4

[eluser]Joshua Logsdon[/eluser]
Yeah, without seeing the code, it sounds like it could even be a browser issue... maybe your click event opens a new window but then tries to continue with the default click functionality?

In other words, is your event returning false (so the href won't happen) or are you stopping propagation of the event? Maybe it's trying to do two things at once and having issues.

Maybe even that pop-up page is referencing some resource that the network has trouble loading initially.




Theme © iAndrew 2016 - Forum software by © MyBB