On Wednesday, May 14, 2014 12:57:50 PM UTC-4, Fred Gruber wrote: > > Hi > Since other people may use the notebook I would prefer if they didn't have > to manually copy the URL. > > I noticed that the javascript variable "document.URL" have this > information but I'm not sure how to bring the value back to python. > > I tried the following in a cell but the webpage changes to another page > with the URL so I'm not sure how to use it. > test='<script>\ > document.write(document.URL);\ > </script>' > html.eval(test) >
Just to see that it works, you can use alert() instead. test='<script>\ a = window.location.hostname;\ alert(a);\ </script>' html.eval(test) And DATA would solve the rest. But I am stumped trying to get the whole thing to work together. And I think that getting the domain name is something that the notebook server is actually unaware of (it runs in various temp directories) so I'm not sure that is possible from within, only with something JS-y. I couldn't quite get it to work, but then again my jQuery is pretty rudimentary. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
