Re: [web2py] Re: How to make this code work ...

2019-06-06 Thread Dave S


On Thursday, June 6, 2019 at 5:03:54 AM UTC-7, Ben Duncan wrote:
>
> Ok, moving it to static makes it work fine. It was in view/default   
> Any IDEAS on what / why this works this way ?
>
> Thanks ...
>
> *Ben Duncan*
> DBA / Chief Software Architect 
> Mississippi State Supreme Court
> Electronic Filing Division
>
>
View isn't really a typical search path ... it's tied to the 
controller/function naming system.

/dps
 

>
> On Wed, Jun 5, 2019 at 9:51 PM Dave S > 
> wrote:
>
>>
>>
>> On Wednesday, June 5, 2019 at 12:47:51 PM UTC-7, Dave S wrote:
>>>
>>>
>>>
>>> On Wednesday, June 5, 2019 at 3:30:46 AM UTC-7, Val K wrote:

 Yes, file:// is even another protocol, so using http transport in this 
 case is out of all standards. But it should work fine with regular web2py 
 app (over http)
>>>
>>>
>>> Since I found a way to successfully demonstrate the javascript working, 
>>> it is quite possible I will not ever pursue the file:// x-site issues.  
>>> I've done OPTIONS handling in node.js before, and I think I can see how to 
>>> do it in the front end (nginx), but I don't have a reason to pursue it at 
>>> present.
>>>
>>> /dps
>>>  
>>>
>>
>>  Although looking through some of my long-open tabs, I see mcm's 
>> cors_origin decorator from October '16, and curiosity might provoke me.
>>
>> -d
>>
>> -- 
>> 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 web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/ac268300-8ec7-4f4d-9d3b-9ffbe7f12f4f%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/93674859-15ab-4de0-bbc8-e64f6c2e9fd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-06 Thread Ben Duncan
Ok, moving it to static makes it work fine. It was in view/default
Any IDEAS on what / why this works this way ?

Thanks ...

*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division


On Wed, Jun 5, 2019 at 9:51 PM Dave S  wrote:

>
>
> On Wednesday, June 5, 2019 at 12:47:51 PM UTC-7, Dave S wrote:
>>
>>
>>
>> On Wednesday, June 5, 2019 at 3:30:46 AM UTC-7, Val K wrote:
>>>
>>> Yes, file:// is even another protocol, so using http transport in this
>>> case is out of all standards. But it should work fine with regular web2py
>>> app (over http)
>>
>>
>> Since I found a way to successfully demonstrate the javascript working,
>> it is quite possible I will not ever pursue the file:// x-site issues.
>> I've done OPTIONS handling in node.js before, and I think I can see how to
>> do it in the front end (nginx), but I don't have a reason to pursue it at
>> present.
>>
>> /dps
>>
>>
>
>  Although looking through some of my long-open tabs, I see mcm's
> cors_origin decorator from October '16, and curiosity might provoke me.
>
> -d
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/ac268300-8ec7-4f4d-9d3b-9ffbe7f12f4f%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAC10dPY5spoodbktBvMTgvdSxf9DPY%3Dv%2B0QCGqQSABi1nECCKA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-05 Thread Dave S


On Wednesday, June 5, 2019 at 12:47:51 PM UTC-7, Dave S wrote:
>
>
>
> On Wednesday, June 5, 2019 at 3:30:46 AM UTC-7, Val K wrote:
>>
>> Yes, file:// is even another protocol, so using http transport in this 
>> case is out of all standards. But it should work fine with regular web2py 
>> app (over http)
>
>
> Since I found a way to successfully demonstrate the javascript working, it 
> is quite possible I will not ever pursue the file:// x-site issues.  I've 
> done OPTIONS handling in node.js before, and I think I can see how to do it 
> in the front end (nginx), but I don't have a reason to pursue it at present.
>
> /dps
>  
>

 Although looking through some of my long-open tabs, I see mcm's 
cors_origin decorator from October '16, and curiosity might provoke me.

-d

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ac268300-8ec7-4f4d-9d3b-9ffbe7f12f4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-05 Thread Dave S


On Wednesday, June 5, 2019 at 3:30:46 AM UTC-7, Val K wrote:
>
> Yes, file:// is even another protocol, so using http transport in this 
> case is out of all standards. But it should work fine with regular web2py 
> app (over http)


Since I found a way to successfully demonstrate the javascript working, it 
is quite possible I will not ever pursue the file:// x-site issues.  I've 
done OPTIONS handling in node.js before, and I think I can see how to do it 
in the front end (nginx), but I don't have a reason to pursue it at present.

/dps
 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/dcc6f167-c02d-4565-9652-09282d28ee0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-05 Thread Dave S


On Wednesday, June 5, 2019 at 5:54:23 AM UTC-7, Ben Duncan wrote:
>
> Put some console logs in to see  strange ...
>
> This site makes use of a SHA-1 Certificate; it’s recommended you use 
> certificates with signature algorithms that use hash functions stronger 
> than SHA-1.
> loadajax 
> In function loaddoc loadajax:14:11 
> 
> readystate= 1 loadajax:18:11 
> status= 0 loadajax:19:11 
> This site makes use of a SHA-1 Certificate; it’s recommended you use 
> certificates with signature algorithms that use hash functions stronger 
> than SHA-1.
> ajax_info.txt 
> readystate= 2 loadajax:18:11 
> status= 404 loadajax:19:11 
> readystate= 3 loadajax:18:11 
> status= 404 loadajax:19:11 
> readystate= 4 loadajax:18:11 
> status= 404
>
> ajax_info is just a text file that Iv'e created that looks like :
> Ajax is not a programming language
> 
>   AJAX
>   AJAX IS A technique for accessing webs ervers from a web page
> 
> AJAX stands for ASYNCHRONOUS Javascript and XML/JSON
>
> *Ben Duncan*
> DBA / Chief Software Architect 
> Mississippi State Supreme Court
> Electronic Filing Division
>
>
And where did you put the file?  From the 404, it wasn't where your 
server-side was looking for it.

My file was in the myapp/uploads directory, and I had "download/" in the 
URL (the fun things at the bottom of controllers/default.py work for me 
pretty much without change).

(I moved the test html+javascript into static, and explicitly loaded it it 
with "myapp/static/test.html".  Putting it on the server got rid of the 
xsite issues.)

/dps



 

>
> On Wed, Jun 5, 2019 at 5:30 AM Val K > 
> wrote:
>
>> Yes, file:// is even another protocol, so using http transport in this 
>> case is out of all standards. But it should work fine with regular web2py 
>> app (over http)
>>
>> -- 
>> 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 web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/70288247-9e3b-4078-81e5-385ef4a4f67e%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6e666126-1436-4d16-bd21-140a2e75b6ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-05 Thread Ben Duncan
Put some console logs in to see  strange ...

This site makes use of a SHA-1 Certificate; it’s recommended you use
certificates with signature algorithms that use hash functions stronger
than SHA-1.
loadajax 
In function loaddoc loadajax:14:11

readystate= 1 loadajax:18:11 
status= 0 loadajax:19:11 
This site makes use of a SHA-1 Certificate; it’s recommended you use
certificates with signature algorithms that use hash functions stronger
than SHA-1.
ajax_info.txt 
readystate= 2 loadajax:18:11 
status= 404 loadajax:19:11 
readystate= 3 loadajax:18:11 
status= 404 loadajax:19:11 
readystate= 4 loadajax:18:11 
status= 404

ajax_info is just a text file that Iv'e created that looks like :
Ajax is not a programming language

  AJAX
  AJAX IS A technique for accessing webs ervers from a web page

AJAX stands for ASYNCHRONOUS Javascript and XML/JSON

*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division


On Wed, Jun 5, 2019 at 5:30 AM Val K  wrote:

> Yes, file:// is even another protocol, so using http transport in this
> case is out of all standards. But it should work fine with regular web2py
> app (over http)
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/70288247-9e3b-4078-81e5-385ef4a4f67e%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAC10dPZLTgabtWTW_qGfp5DwO0AS%3DD_-HpU6c-xTLznq4LNrmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-05 Thread Val K
Yes, file:// is even another protocol, so using http transport in this case is 
out of all standards. But it should work fine with regular web2py app (over 
http)

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/70288247-9e3b-4078-81e5-385ef4a4f67e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-05 Thread Dave S


On Tuesday, June 4, 2019 at 10:11:43 PM UTC-7, Val K wrote:
>
> Try xhttp.withCredentials = true


I did.  The tricky part is that using a file on the browser's host, the 
first request is OPTIONS.

/dps
 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/346e49d1-d90e-45ad-82b8-82a855ea0867%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-04 Thread Val K
Try xhttp.withCredentials = true

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/dc165381-8990-436e-a91d-8dccf6aca4f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-04 Thread Dave S
$

On Tuesday, June 4, 2019 at 6:00:44 PM UTC-7, Dave S wrote:
>
>
>
> On Tuesday, June 4, 2019 at 3:16:12 PM UTC-7, Ben Duncan wrote:
>>
>> I've been trying to run it ... When you click on the button it does 
>> nothing
>>
>> *Ben Duncan*
>> DBA / Chief Software Architect 
>> Mississippi State Supreme Court
>> Electronic Filing Division
>>
>>
>>
>
> When I replace the "ajax-info.txt" with a real URL (that is, one for a 
> web2py function on my server, and which returns a txt file), I see the 
> network access, including a response with HTTP status 303.  For some reason 
> (cookie management?) it doesn't work for me to login via a separate tab, 
> and each time I click the button I get a different cookie.  I've been 
> poking at sending credentials, but I still get the 303 response and I 
> apparently am not setting the Authorization header as I think I am, but 
> only setting Access-Control-Request-Headers to "authorization".  And there 
> is also "allow origin" issues, because file://tmp/test.html comes from a 
> different address than the server.
>
> HTH
> /dps
>
>

The cross-site and authorization issues go away when you host the file on 
the server (say, .../applications/myapp/static/test.html)

/dps
 

>
> On Tue, Jun 4, 2019 at 4:35 PM Anthony  wrote:
>>
>>> What are you trying to do? That code should work fine in web2py, as it's 
>>> just Javascript. You just need to have it call a web2py URL. Of course, 
>>> web2py includes some built-in mechanisms for handling Ajax requests, such 
>>> as the ajax() Javascript function and the LOAD() helper to create Ajax 
>>> components.
>>>
>>> Anthony
>>>
>>> On Tuesday, June 4, 2019 at 3:23:11 PM UTC-4, Ben Duncan wrote:

 Ok, the following is code from w3 schools:
 https://www.w3schools.com/js/js_ajax_intro.asp

 The code is as follows :

 
 
 

 
 The XMLHttpRequest Object
 Change Content
 

 
 function loadDoc() {
   var xhttp = new XMLHttpRequest();
   xhttp.onreadystatechange = function() {
 if (this.readyState == 4 && this.status == 200) {
   document.getElementById("demo").innerHTML =
   this.responseText;
 }
   };
   xhttp.open("GET", "ajax_info.txt", true);
   xhttp.send();
 }
 

 
 

 The question is how do I get this code to run under web2py ?

 Thanks ...

 *Ben Duncan*
 DBA / Chief Software Architect 
 Mississippi State Supreme Court
 Electronic Filing Division

>>> -- 
>>> 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 web...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/9b9fa219-3038-4d61-9206-a5ab134f783e%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c78b2647-cd05-42d5-9c9b-26e067309eb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-04 Thread Dave S


On Tuesday, June 4, 2019 at 3:16:12 PM UTC-7, Ben Duncan wrote:
>
> I've been trying to run it ... When you click on the button it does nothing
>
> *Ben Duncan*
> DBA / Chief Software Architect 
> Mississippi State Supreme Court
> Electronic Filing Division
>
>
>

When I replace the "ajax-info.txt" with a real URL (that is, one for a 
web2py function on my server, and which returns a txt file), I see the 
network access, including a response with HTTP status 303.  For some reason 
(cookie management?) it doesn't work for me to login via a separate tab, 
and each time I click the button I get a different cookie.  I've been 
poking at sending credentials, but I still get the 303 response and I 
apparently am not setting the Authorization header as I think I am, but 
only setting Access-Control-Request-Headers to "authorization".  And there 
is also "allow origin" issues, because file://tmp/test.html comes from a 
different address than the server.

HTH
/dps


On Tue, Jun 4, 2019 at 4:35 PM Anthony > 
> wrote:
>
>> What are you trying to do? That code should work fine in web2py, as it's 
>> just Javascript. You just need to have it call a web2py URL. Of course, 
>> web2py includes some built-in mechanisms for handling Ajax requests, such 
>> as the ajax() Javascript function and the LOAD() helper to create Ajax 
>> components.
>>
>> Anthony
>>
>> On Tuesday, June 4, 2019 at 3:23:11 PM UTC-4, Ben Duncan wrote:
>>>
>>> Ok, the following is code from w3 schools:
>>> https://www.w3schools.com/js/js_ajax_intro.asp
>>>
>>> The code is as follows :
>>>
>>> 
>>> 
>>> 
>>>
>>> 
>>> The XMLHttpRequest Object
>>> Change Content
>>> 
>>>
>>> 
>>> function loadDoc() {
>>>   var xhttp = new XMLHttpRequest();
>>>   xhttp.onreadystatechange = function() {
>>> if (this.readyState == 4 && this.status == 200) {
>>>   document.getElementById("demo").innerHTML =
>>>   this.responseText;
>>> }
>>>   };
>>>   xhttp.open("GET", "ajax_info.txt", true);
>>>   xhttp.send();
>>> }
>>> 
>>>
>>> 
>>> 
>>>
>>> The question is how do I get this code to run under web2py ?
>>>
>>> Thanks ...
>>>
>>> *Ben Duncan*
>>> DBA / Chief Software Architect 
>>> Mississippi State Supreme Court
>>> Electronic Filing Division
>>>
>> -- 
>> 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 web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/9b9fa219-3038-4d61-9206-a5ab134f783e%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e58217b0-df00-4897-aa57-40a92b019ada%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-04 Thread Ben Duncan
I've been trying to run it ... When you click on the button it does nothing

*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division


On Tue, Jun 4, 2019 at 4:35 PM Anthony  wrote:

> What are you trying to do? That code should work fine in web2py, as it's
> just Javascript. You just need to have it call a web2py URL. Of course,
> web2py includes some built-in mechanisms for handling Ajax requests, such
> as the ajax() Javascript function and the LOAD() helper to create Ajax
> components.
>
> Anthony
>
> On Tuesday, June 4, 2019 at 3:23:11 PM UTC-4, Ben Duncan wrote:
>>
>> Ok, the following is code from w3 schools:
>> https://www.w3schools.com/js/js_ajax_intro.asp
>>
>> The code is as follows :
>>
>> 
>> 
>> 
>>
>> 
>> The XMLHttpRequest Object
>> Change Content
>> 
>>
>> 
>> function loadDoc() {
>>   var xhttp = new XMLHttpRequest();
>>   xhttp.onreadystatechange = function() {
>> if (this.readyState == 4 && this.status == 200) {
>>   document.getElementById("demo").innerHTML =
>>   this.responseText;
>> }
>>   };
>>   xhttp.open("GET", "ajax_info.txt", true);
>>   xhttp.send();
>> }
>> 
>>
>> 
>> 
>>
>> The question is how do I get this code to run under web2py ?
>>
>> Thanks ...
>>
>> *Ben Duncan*
>> DBA / Chief Software Architect
>> Mississippi State Supreme Court
>> Electronic Filing Division
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/9b9fa219-3038-4d61-9206-a5ab134f783e%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAC10dPa2-zKpNW1fMkLZz4FtDZjm-XQgB9dfd8%3Dqou-o1qyyaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to make this code work ...

2019-06-04 Thread Anthony
What are you trying to do? That code should work fine in web2py, as it's 
just Javascript. You just need to have it call a web2py URL. Of course, 
web2py includes some built-in mechanisms for handling Ajax requests, such 
as the ajax() Javascript function and the LOAD() helper to create Ajax 
components.

Anthony

On Tuesday, June 4, 2019 at 3:23:11 PM UTC-4, Ben Duncan wrote:
>
> Ok, the following is code from w3 schools:
> https://www.w3schools.com/js/js_ajax_intro.asp
>
> The code is as follows :
>
> 
> 
> 
>
> 
> The XMLHttpRequest Object
> Change Content
> 
>
> 
> function loadDoc() {
>   var xhttp = new XMLHttpRequest();
>   xhttp.onreadystatechange = function() {
> if (this.readyState == 4 && this.status == 200) {
>   document.getElementById("demo").innerHTML =
>   this.responseText;
> }
>   };
>   xhttp.open("GET", "ajax_info.txt", true);
>   xhttp.send();
> }
> 
>
> 
> 
>
> The question is how do I get this code to run under web2py ?
>
> Thanks ...
>
> *Ben Duncan*
> DBA / Chief Software Architect 
> Mississippi State Supreme Court
> Electronic Filing Division
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/9b9fa219-3038-4d61-9206-a5ab134f783e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.