Skip to Content
0

load() not triggering after deploying to server.

Mar 11, 2017 at 08:36 AM

67

avatar image

Hi Everyone,

I am using browser load() inside onInit() method as below,

This is working perfectly while am running locally in Eclipse.

But after deploying to server "load()" is not executing.

Kindly help....

Thanks,

Srinath

load.png (7.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Swaroop Anasane Mar 11, 2017 at 09:26 AM
0

Hi Srinath,

Seems like you have kept it in controller, any specific reason? Window loads independent of view, and the method would be called on window load.

Regards,

Swaroop

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Swaroop,

Thank you for response.

The reason to put it in Controller is, we have one Odata service to get the data and we are calling inside onInit. Due to some issue, we decided to call the odata service with a time delay (say 100ms) if page is rendering on REFRESH otherwise call directly(without time delay) if page is loading for the first time.

From load() event handler, we get 1 on refresh (if user clicks refresh) and on first time launch 0.

But the same code when i run in Eclipse it is successful. Issue comes after deploying to server.

Thanks,

Srinath

0

Okay,

What browser so you use to run deployed application? Looks like compatibility.

Regards,

Swaroop

0

I am running in Chrome and same behavior can bee seen in IE as well.

One difference between the code i have from local VS server is, "minification of JS files".

In server, if i enable debugging mode (removing minification of js files) then load() is firing.

Thanks,

Srinath

0
Jun Wu Mar 11, 2017 at 11:58 AM
0

why you depend on this? cannot put it in component init?

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Jun Wu,

Thank you for the response.

We need to call odata service inside onInit() and in order to identify how the page is rendering (either on refresh OR first time).

From the load() we get 1 on refresh and 0 on first time launch. Based on the Number i will make odata call.

Thanks,

Srinath

0