web2py_component does not work with https...

93 views
Skip to first unread message

António Ramos

unread,
Jun 21, 2017, 4:47:54 AM6/21/17
to web...@googlegroups.com
hello i noticed that if i switch to https my pages does not load the components using the
web2py_component function

Is this true?

regards

Leonel Câmara

unread,
Jun 21, 2017, 7:25:03 AM6/21/17
to web2py-users
The browser will block it if the request is not HTTPS too.

António Ramos

unread,
Jun 21, 2017, 8:19:40 AM6/21/17
to web...@googlegroups.com
Leonel you just confused me again...

web2py_component works with Http

web2py_component does not work with HTTPS. In this case how can i use web2py_component ?

Regards

2017-06-21 12:25 GMT+01:00 Leonel Câmara <leonel...@gmail.com>:
The browser will block it if the request is not HTTPS too.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Leonel Câmara

unread,
Jun 21, 2017, 11:17:53 AM6/21/17
to web2py-users
web2py_component works with https of course, but maybe for some reason the URL it's requesting is not in HTTPS. Can we see your web2py_component call?

António Ramos

unread,
Jun 21, 2017, 12:37:03 PM6/21/17
to web...@googlegroups.com
<div class="small-box bg-red" id="people" onclick="$('#innerpeople').attr('class', 'fa fa-hourglass-end');web2py_component('/fileit/kpi/people.load', target='people')" style="cursor:pointer !important;"><div class="inner"><h3>???</h3><p>Pessoas</p></div><div class="icon"><i class="fa fa-mouse-pointer" id="innerpeople"></i></div><a class="small-box-footer">Carregar para atualizar...</a>
</div>


Obrigado :)

2017-06-21 16:17 GMT+01:00 Leonel Câmara <leonel...@gmail.com>:
web2py_component works with https of course, but maybe for some reason the URL it's requesting is not in HTTPS. Can we see your web2py_component call?

--

Leonel Câmara

unread,
Jun 21, 2017, 12:49:31 PM6/21/17
to web2py-users
Humm that should actually work, although I would recommend using URL, instead of hardcoding the URL.

The reason for the failure must be something else. Maybe an insecure cookie or something, are any tickets generated by web2py? What error do you get in the browser console?

António Ramos

unread,
Jun 21, 2017, 12:56:21 PM6/21/17
to web...@googlegroups.com
No tickets and no console errors....
i will try URL....

2017-06-21 17:49 GMT+01:00 Leonel Câmara <leonel...@gmail.com>:
Humm that should actually work, although I would recommend using URL, instead of hardcoding the URL.

The reason for the failure must be something else. Maybe an insecure cookie or something, are any tickets generated by web2py? What error do you get in the browser console?

--

António Ramos

unread,
Jun 21, 2017, 12:57:26 PM6/21/17
to web...@googlegroups.com
I already was using URL

 {{if 'kpi' in locals():}}
 {{for x in kpi:}}
 {{url=URL('kpi',x['kpi']+'.load')}}
 {{setwait="$('#inner{0}').attr('class', 'fa fa-hourglass-end');".format(x['kpi']) }}
 {{setclick="web2py_component('{0}', target='{1}')".format(url,x['kpi']) }}
 {{click=setwait+setclick}}
 {{=DIV(DIV(H3("???"),P(x["waiting"]),_class="inner"),DIV(I(_id='inner'+x['kpi'],_class="fa fa-mouse-pointer"),_class="icon"),A(T("click to update..."),_class="small-box-footer"),_class="small-box bg-red"
 ,_id=x["kpi"],_onclick=click,_style="cursor:pointer !important;")}}
 {{pass}}
 {{pass}}

António Ramos

unread,
Jun 21, 2017, 1:01:45 PM6/21/17
to web...@googlegroups.com
First i see this 
Imagem inline 1
Then i click and i get 
Imagem inline 2

Here the web2py_component should load the component but it doesnt...
this is the result of loading the component. It works with http and does not work if i switch to https....
Imagem inline 3

Leonel Câmara

unread,
Jun 21, 2017, 2:17:08 PM6/21/17
to web2py-users
Can visit your website using https, then open a browser console go to the network tab, and show me what appears there when you click the button?

António Ramos

unread,
Jun 22, 2017, 6:01:09 AM6/22/17
to web...@googlegroups.com
I think i know why no console errors nor admin tickets

this is the last line that is executed and comes from jquery

Imagem inline 1

after this line i get

Imagem inline 2

any ideas ?


2017-06-21 19:17 GMT+01:00 Leonel Câmara <leonel...@gmail.com>:
Can visit your website using https, then open a browser console go to the network tab, and show me what appears there when you click the button?

--

Leonel Câmara

unread,
Jun 22, 2017, 6:48:38 AM6/22/17
to web2py-users
No idea, I guess you could try with a different jQuery version. Not sure it would fix anything.

Anthony

unread,
Jun 22, 2017, 10:33:52 AM6/22/17
to web...@googlegroups.com
Not sure how this would be related to things working over http vs. https, but:

typeof jQuery !== strundefined

should be:

typeof jQuery !== 'undefined'

Are you checking http vs. https in two different browsers, where the https browser has the above Javascript code cached, but the http browser does not?

Anthony

António Ramos

unread,
Jun 26, 2017, 6:39:43 AM6/26/17
to web...@googlegroups.com
Upgraded jquery to latest... working now...
Also i´m not using jquery shipped with web2py
I am using the latest from google CDN
Will i have problems with  this ?

Regards

2017-06-22 15:33 GMT+01:00 Anthony <abas...@gmail.com>:
Not sure how this would be related to things working over http vs. https, but:

typeof jQuery !== strundefined

should be:

typeof jQuery != 'undefined'

Richard Vézina

unread,
Jun 27, 2017, 1:21:24 PM6/27/17
to web2py-users
Hmm... Google CDN is not always on the cutting edge... You should use the same version as the one ship with web2py if you want to avoid any issues... You have to conduct your on due diligence testing if you upgrade it...

Richard

Dave S

unread,
Jun 28, 2017, 6:20:33 AM6/28/17
to web2py-users


On Tuesday, June 27, 2017 at 10:21:24 AM UTC-7, Richard wrote:
Hmm... Google CDN is not always on the cutting edge...

Sometimes that's a good thing  (like web2py stable versions).
 
You should use the same version as the one ship with web2py if you want to avoid any issues...

And that would be even less cutting edge, which can be a good thing.
 
You have to conduct your on due diligence testing if you upgrade it...

Richard

Automated testing, if you can.

/dps
 

To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages