OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

wsrp message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: Javascript URL comment


I plan to test this with other HTML controls next week.

In the mean time, I'm copying this to the TC to see if others know about 
any problematic usage styles.

Subbu

Rich Thompson wrote:
> 
> Sounds like another way to deal with nested Javascript urls!
> 
> Key question, does it work on tags other than forms (e.g. anchor tags, 
> etc)?
> 
> Rich
> 
> 
> *Subbu Allamaraju <subbu@bea.com>*
> 
> 05/09/06 09:50 AM
> 
> 	
> To
> 	Rich Thompson/Watson/IBM@IBMUS
> cc
> 	
> Subject
> 	Re: Javascript URL comment
> 
> 
> 	
> 
> 
> 
> 
> 
> Does the following example reflect the issue?
> 
> <form method="post"
>       onsubmit="javascript:processForm(this,
> 'javascript:pbia(\'http://localhost/wsrp/response.php\', showXMLData)',
> event)">
>   <input name="name"/>
>   <input name="submit" type="Submit"/>
> </form>
> 
> Here the processForm is the portletFunc and pbia is the portalFunc.
> showXMLData is the portlet callback.
> 
> The function processForm sets the action URL on the form and returns true.
> 
>       function processForm(form, url, event)
>       {
>         form.action = url;
>         return true;
>       }
> 
> The function pbia uses an XHR to submit the form.
> 
>       function pbia(url, callback)
>       {
>         var request = getRequest();
>         request.onreadystatechange = function()
>         {
>             if(request.readyState == 4) {
>                 if(request.status == 200) {
>                     var response = request.responseXML.documentElement;
>                     var someInfo = response.firstChild;
>                     callback(someInfo.nextSibling);
>                 }
>             }
>         };
>         request.open('POST', url, true);
>         request.send(body); // TODO
>      }
> 
> This example works correctly in different browsers (checked in FF and
> Opera).
> 
> Subbu
> 
> Rich Thompson wrote:
>  >
>  > I have only referred to the use cases you are thinking of. Probably the
>  > most common case is:
>  >
>  >   <a href="javascript:portletFunc(parm1, parm2, url, parm3, ...)
>  > ...">...</a>
>  >
>  > which, using a Consumer rewrite url becomes:
>  >
>  >   <a href="javascript:portletFunc(parm1, parm2,
>  > 'wsrp_rewrite?wsrp-urlType=...', parm3, ...) ...">...</a>
>  >
>  > which the Consumer rewrites into:
>  >
>  >   <a href="javascript:portletFunc(parm1, parm2,
>  > 'javascript:portalFunc(p1, p2, rewrittenURL)', parm3, ...) ...">...</a>
>  >
>  > This results in the problem of nested javascript URLs ...
>  >
>  > Rich
>  >
>  >
>  > *Subbu Allamaraju <subbu@bea.com>*
>  >
>  > 05/08/06 04:56 PM
>  >
>  >                  
>  > To
>  >                  Rich Thompson/Watson/IBM@IBMUS
>  > cc
>  >                  
>  > Subject
>  >                  Javascript URL comment
>  >
>  >
>  >                  
>  >
>  >
>  >
>  >
>  >
>  > Hi Rich,
>  >
>  > I was looking at your comments on nested scripts for Ajax use cases.
>  >
>  > Let's say, a consumer uses a javascript: URL. A portlet can use this in
>  > html as well as javascript, as in
>  >
>  >  <a href="javascript:..">...</a>
>  >
>  >  <script>
>  >  function xyz(form) {
>  >    var url = "javascript:...";
>  >    form.action = url;
>  >    return true;
>  >  }
>  >  </script>
>  >
>  >  From your comment, I thought that you were referring using an inline
>  > script for URLs. But, it can quickly cause bad URLs in the markup, as in
>  >
>  >  <a href="<script>...</script>">...</a>
>  >
>  > Browser would interpret this a normal relative URL.
>  >
>  > I may not have understood your comments or missing the use case - could
>  > you clarify?
>  >
>  > Thanks
>  > Subbu
>  >
>  >
>  >
> 
> 
> 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]