[xwiki-users] How do I for receive a very long string as a parameter in a funtion?
I am trying to receive a very long url (1000 characters) as a parameter for use it in a pop up window, but fail if I try with a shortest one work fine. Thanks in advance <script type="text/javascript"> function newPopup(url) { popupWindow = window.open(url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,tool bar=yes,menubar=no,location=no,directories=no,status=yes') } </script> <a href= "JavaScript:newPopup ('http://testforge.int-evry.fr/d2r-server/snorql/?query=%09%09SELECT+DISTINCT++%3Fname+%3Fpackage+WHERE+%7B%0D%0A%09%09%7B%0D%0A%09%09%3Freported+bom%3AhasReporter+%3Freporter.%0D%0A%09%09%3Freporter+sioc%3Aname+%3Fname.+FILTER+%28%3Fname+%3D+%22Berger%22%29%0D%0A%09%09%3Freported+dc%3Atitle+%3Ftitle.%0D%0A%09%09%3Freported+bom%3AisIssueOf+%3Fspackage.%0D%0A%09%09%3Fspackage+helios_bt%3Aname+%3Fpackage.+%0D%0A%09%09%7D+UNION+%7B%0D%0A%09%09%3Fmonitored+bom%3AhasCCPerson+%3Fperson.%0D%0A%09%09%3Fperson+foaf%3Aname+%3Fname.+FILTER+%28%3Fname+%3D+%22Berger%22%29%0D%0A%09%09%3Freporter+sioc%3Aaccount_of+%3Fperson.%0D%0A%09%09%3Fmonitored+dc%3Atitle+%3Ftitle.%0D%0A%09%09%3Fmonitored+bom%3AisIssueOf+%3Fspackage.%0D%0A%09%09%3Fmonitored+vocabProperty%3Apackage+%3Fpackage.+%0D%0A%09%09%7D%0D%0A%09%09%7D+ORDER+BY+%3Fpackage%0D%0A');">Bugs reported</a>
Hello, What you should do is to escape the URL using the Velocity escaping tool (http://velocity.apache.org/tools/devel/generic/EscapeTool.html) : #set($url = $escapetool.url('http://testforge.int-evry.fr/d2r-server/snorql/?query=%09%09SELECT+DISTINCT+...')) <a href="javascript:newPopup('$url');">Bugs reported</a> Raluca. On Thu, Aug 26, 2010 at 1:27 PM, Francis Abrante <[email protected]> wrote:
I am trying to receive a very long url (1000 characters) as a parameter for use it in a pop up window, but fail if I try with a shortest one work fine. Thanks in advance
<script type="text/javascript"> function newPopup(url) { popupWindow = window.open(url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,tool bar=yes,menubar=no,location=no,directories=no,status=yes') } </script>
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
The link works fine now : ) , but when I put this $name+$lastname inside the query does not take the values stores in the variables, How do I for pass the parameters? Thanks a lot -- View this message in context: http://xwiki.475771.n2.nabble.com/How-do-I-for-receive-a-very-long-string-as... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, For the Velocity syntax to be interpreted inside a String, you have to use double quotes ( "string_with_velocity_inside"). Raluca. On Fri, Aug 27, 2010 at 12:33 PM, abrante <[email protected]> wrote:
The link works fine now : ) , but when I put this $name+$lastname inside the query does not take the values stores in the variables, How do I for pass the parameters? Thanks a lot -- View this message in context: http://xwiki.475771.n2.nabble.com/How-do-I-for-receive-a-very-long-string-as... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On Fri, Aug 27, 2010 at 1:52 PM, Raluca Stavro <[email protected]> wrote:
Hi,
For the Velocity syntax to be interpreted inside a String, you have to use double quotes ( "string_with_velocity_inside").
You can also use concatenation: $velocity_var.concat('string_inside_simple_quots') This way the string will not be parsed -> better performance. Raluca.
Raluca.
On Fri, Aug 27, 2010 at 12:33 PM, abrante <[email protected]> wrote:
The link works fine now : ) , but when I put this $name+$lastname inside the query does not take the values stores in the variables, How do I for pass the parameters? Thanks a lot -- View this message in context: http://xwiki.475771.n2.nabble.com/How-do-I-for-receive-a-very-long-string-as... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (3)
-
abrante -
Francis Abrante -
Raluca Stavro