You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by e....@student.utwente.nl on 2007/01/23 12:07:18 UTC

javascript in portlet.jsp

Hi,
 
can someone tell me how to include javacript in my portlet.jsp?
 
Regards
 
Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: javascript in portlet.jsp

Posted by Philip Mark Donaghy <ph...@gmail.com>.
Hi,

On 1/23/07, e.j.w.vanbloem@student.utwente.nl
<e....@student.utwente.nl> wrote:
> yes, i simplefied the code for this mail and made a copy mistake.
> Do you know why this jsp does not print the name on the page?

Yes because portlets are HTML fragments and the <head> and <body> tags
are not permitted. At least not in best practice.

Philip

>
>
>
>  fckeditor.js:
>  function a_message()
>  {
>  var name = "erik";
>   return name;
>  }
>
>  test.jsp:
>  <head>
>            <script language="javascript" type="text/javascript" src="fckeditor.js"></script>
>  </HEAD>
>  <body>
>    <script language="javascript" type="text/javascript">
>           document.write( a_message())
>  </script>
>
> ________________________________
>
> Van: Aaron Evans [mailto:aaronmevans@gmail.com]
> Verzonden: di 23-1-2007 16:25
> Aan: Jetspeed Users List
> Onderwerp: Re: javascript in portlet.jsp
>
>
>
> wouldn't it be:
>
> document.write(a_message());
>
> ?
>
> On 1/23/07, e.j.w.vanbloem@student.utwente.nl
> <e....@student.utwente.nl> wrote:
> > Thank you it works,
> >
> > only I do not get the var from the external js, any hint or working examples?
> > Regards
> >
> > fckeditor.js:
> > function a_message()
> > {
> > var name = "erik";
> >  return name;
> > }
> >
> > test.jsp:
> > <head>
> > <script language="javascript" type="text/javascript" src="fckeditor.js"></script>
> > </HEAD>
> > <body>
> > <script language="javascript" type="text/javascript">
> >
> > document.write( function())
> >
> > </script>
> >
> >
> > ________________________________
> >
> > Van: Aaron Evans [mailto:aaronmevans@gmail.com]
> > Verzonden: di 23-1-2007 15:26
> > Aan: Jetspeed Users List
> > Onderwerp: Re: javascript in portlet.jsp
> >
> >
> >
> > Try this instead:
> >
> > <script language="javascript" type="text/javascript">
> > <!--
> >
> > var oFCKeditor = new FCKeditor('FCKeditor1');
> > oFCKeditor.BasePath = "/FCKeditor/";
> > oFCKeditor.Create();
> > document.write("Welcome to my world!!!");
> >
> > //-->
> > </script>
> >
> > On 1/23/07, e.j.w.vanbloem@student.utwente.nl
> > <e....@student.utwente.nl> wrote:
> > > Hi
> > >
> > > I tried the code below, but when I put it in jetspeed it does not show the content of the script (not even the hello world). Can you give me an example that works?
> > >
> > > Regards
> > >
> > > <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
> > >     pageEncoding="ISO-8859-1"%>
> > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> > > <HTML>
> > >         <HEAD>
> > >         <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> > >         <TITLE>UserPortlet</TITLE>
> > >         <script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
> > >         </HEAD>
> > >         <BODY>
> > > <br> test <br>
> > > <script language="javascript" type="text/javascript">
> > > var oFCKeditor = new FCKeditor('FCKeditor1');
> > > oFCKeditor.BasePath = "/FCKeditor/";
> > > oFCKeditor.Create();
> > > document.write("Welcome to my world!!!");
> > >
> > > </script>
> > > <%..................
> > >
> > >
> > > ________________________________
> > >
> > > Van: Martin Dulisch [mailto:mdulisch@gmail.com]
> > > Verzonden: di 23-1-2007 12:38
> > > Aan: Jetspeed Users List
> > > Onderwerp: Re: javascript in portlet.jsp
> > >
> > >
> > >
> > > Hi Erik,
> > >
> > > you can place a "script" tag in your portlet.jsp
> > >
> > > Martin
> > >
> > >
> > > 2007/1/23, e.j.w.vanbloem@student.utwente.nl <
> > > e.j.w.vanbloem@student.utwente.nl>:
> > > >
> > > > Hi,
> > > >
> > > > can someone tell me how to include javacript in my portlet.jsp?
> > > >
> > > > Regards
> > > >
> > > > Erik
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > > > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> > > >
> > > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>


-- 
Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy/philip
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


RE: javascript in portlet.jsp

Posted by e....@student.utwente.nl.
yes, i simplefied the code for this mail and made a copy mistake.
Do you know why this jsp does not print the name on the page?
 
 
 
 fckeditor.js:
 function a_message()
 {
 var name = "erik";
  return name;
 }

 test.jsp:
 <head>
           <script language="javascript" type="text/javascript" src="fckeditor.js"></script>
 </HEAD>
 <body>
   <script language="javascript" type="text/javascript">
          document.write( a_message())
 </script>

________________________________

Van: Aaron Evans [mailto:aaronmevans@gmail.com]
Verzonden: di 23-1-2007 16:25
Aan: Jetspeed Users List
Onderwerp: Re: javascript in portlet.jsp



wouldn't it be:

document.write(a_message());

?

On 1/23/07, e.j.w.vanbloem@student.utwente.nl
<e....@student.utwente.nl> wrote:
> Thank you it works,
>
> only I do not get the var from the external js, any hint or working examples?
> Regards
>
> fckeditor.js:
> function a_message()
> {
> var name = "erik";
>  return name;
> }
>
> test.jsp:
> <head>
> <script language="javascript" type="text/javascript" src="fckeditor.js"></script>
> </HEAD>
> <body>
> <script language="javascript" type="text/javascript">
>
> document.write( function())
>
> </script>
>
>
> ________________________________
>
> Van: Aaron Evans [mailto:aaronmevans@gmail.com]
> Verzonden: di 23-1-2007 15:26
> Aan: Jetspeed Users List
> Onderwerp: Re: javascript in portlet.jsp
>
>
>
> Try this instead:
>
> <script language="javascript" type="text/javascript">
> <!--
>
> var oFCKeditor = new FCKeditor('FCKeditor1');
> oFCKeditor.BasePath = "/FCKeditor/";
> oFCKeditor.Create();
> document.write("Welcome to my world!!!");
>
> //-->
> </script>
>
> On 1/23/07, e.j.w.vanbloem@student.utwente.nl
> <e....@student.utwente.nl> wrote:
> > Hi
> >
> > I tried the code below, but when I put it in jetspeed it does not show the content of the script (not even the hello world). Can you give me an example that works?
> >
> > Regards
> >
> > <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
> >     pageEncoding="ISO-8859-1"%>
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> > <HTML>
> >         <HEAD>
> >         <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> >         <TITLE>UserPortlet</TITLE>
> >         <script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
> >         </HEAD>
> >         <BODY>
> > <br> test <br>
> > <script language="javascript" type="text/javascript">
> > var oFCKeditor = new FCKeditor('FCKeditor1');
> > oFCKeditor.BasePath = "/FCKeditor/";
> > oFCKeditor.Create();
> > document.write("Welcome to my world!!!");
> >
> > </script>
> > <%..................
> >
> >
> > ________________________________
> >
> > Van: Martin Dulisch [mailto:mdulisch@gmail.com]
> > Verzonden: di 23-1-2007 12:38
> > Aan: Jetspeed Users List
> > Onderwerp: Re: javascript in portlet.jsp
> >
> >
> >
> > Hi Erik,
> >
> > you can place a "script" tag in your portlet.jsp
> >
> > Martin
> >
> >
> > 2007/1/23, e.j.w.vanbloem@student.utwente.nl <
> > e.j.w.vanbloem@student.utwente.nl>:
> > >
> > > Hi,
> > >
> > > can someone tell me how to include javacript in my portlet.jsp?
> > >
> > > Regards
> > >
> > > Erik
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: javascript in portlet.jsp

Posted by Aaron Evans <aa...@gmail.com>.
wouldn't it be:

document.write(a_message());

?

On 1/23/07, e.j.w.vanbloem@student.utwente.nl
<e....@student.utwente.nl> wrote:
> Thank you it works,
>
> only I do not get the var from the external js, any hint or working examples?
> Regards
>
> fckeditor.js:
> function a_message()
> {
> var name = "erik";
>  return name;
> }
>
> test.jsp:
> <head>
> <script language="javascript" type="text/javascript" src="fckeditor.js"></script>
> </HEAD>
> <body>
> <script language="javascript" type="text/javascript">
>
> document.write( function())
>
> </script>
>
>
> ________________________________
>
> Van: Aaron Evans [mailto:aaronmevans@gmail.com]
> Verzonden: di 23-1-2007 15:26
> Aan: Jetspeed Users List
> Onderwerp: Re: javascript in portlet.jsp
>
>
>
> Try this instead:
>
> <script language="javascript" type="text/javascript">
> <!--
>
> var oFCKeditor = new FCKeditor('FCKeditor1');
> oFCKeditor.BasePath = "/FCKeditor/";
> oFCKeditor.Create();
> document.write("Welcome to my world!!!");
>
> //-->
> </script>
>
> On 1/23/07, e.j.w.vanbloem@student.utwente.nl
> <e....@student.utwente.nl> wrote:
> > Hi
> >
> > I tried the code below, but when I put it in jetspeed it does not show the content of the script (not even the hello world). Can you give me an example that works?
> >
> > Regards
> >
> > <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
> >     pageEncoding="ISO-8859-1"%>
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> > <HTML>
> >         <HEAD>
> >         <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> >         <TITLE>UserPortlet</TITLE>
> >         <script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
> >         </HEAD>
> >         <BODY>
> > <br> test <br>
> > <script language="javascript" type="text/javascript">
> > var oFCKeditor = new FCKeditor('FCKeditor1');
> > oFCKeditor.BasePath = "/FCKeditor/";
> > oFCKeditor.Create();
> > document.write("Welcome to my world!!!");
> >
> > </script>
> > <%..................
> >
> >
> > ________________________________
> >
> > Van: Martin Dulisch [mailto:mdulisch@gmail.com]
> > Verzonden: di 23-1-2007 12:38
> > Aan: Jetspeed Users List
> > Onderwerp: Re: javascript in portlet.jsp
> >
> >
> >
> > Hi Erik,
> >
> > you can place a "script" tag in your portlet.jsp
> >
> > Martin
> >
> >
> > 2007/1/23, e.j.w.vanbloem@student.utwente.nl <
> > e.j.w.vanbloem@student.utwente.nl>:
> > >
> > > Hi,
> > >
> > > can someone tell me how to include javacript in my portlet.jsp?
> > >
> > > Regards
> > >
> > > Erik
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


RE: javascript in portlet.jsp

Posted by e....@student.utwente.nl.
Thank you it works,
 
only I do not get the var from the external js, any hint or working examples?
Regards
 
fckeditor.js:
function a_message() 
{ 
var name = "erik"; 
 return name;
} 
 
test.jsp:
<head>
<script language="javascript" type="text/javascript" src="fckeditor.js"></script>
</HEAD>
<body>
<script language="javascript" type="text/javascript">

document.write( function())

</script>


________________________________

Van: Aaron Evans [mailto:aaronmevans@gmail.com]
Verzonden: di 23-1-2007 15:26
Aan: Jetspeed Users List
Onderwerp: Re: javascript in portlet.jsp



Try this instead:

<script language="javascript" type="text/javascript">
<!--

var oFCKeditor = new FCKeditor('FCKeditor1');
oFCKeditor.BasePath = "/FCKeditor/";
oFCKeditor.Create();
document.write("Welcome to my world!!!");

//-->
</script>

On 1/23/07, e.j.w.vanbloem@student.utwente.nl
<e....@student.utwente.nl> wrote:
> Hi
>
> I tried the code below, but when I put it in jetspeed it does not show the content of the script (not even the hello world). Can you give me an example that works?
>
> Regards
>
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
>     pageEncoding="ISO-8859-1"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <HTML>
>         <HEAD>
>         <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
>         <TITLE>UserPortlet</TITLE>
>         <script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
>         </HEAD>
>         <BODY>
> <br> test <br>
> <script language="javascript" type="text/javascript">
> var oFCKeditor = new FCKeditor('FCKeditor1');
> oFCKeditor.BasePath = "/FCKeditor/";
> oFCKeditor.Create();
> document.write("Welcome to my world!!!");
>
> </script>
> <%..................
>
>
> ________________________________
>
> Van: Martin Dulisch [mailto:mdulisch@gmail.com]
> Verzonden: di 23-1-2007 12:38
> Aan: Jetspeed Users List
> Onderwerp: Re: javascript in portlet.jsp
>
>
>
> Hi Erik,
>
> you can place a "script" tag in your portlet.jsp
>
> Martin
>
>
> 2007/1/23, e.j.w.vanbloem@student.utwente.nl <
> e.j.w.vanbloem@student.utwente.nl>:
> >
> > Hi,
> >
> > can someone tell me how to include javacript in my portlet.jsp?
> >
> > Regards
> >
> > Erik
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: javascript in portlet.jsp

Posted by Aaron Evans <aa...@gmail.com>.
Try this instead:

<script language="javascript" type="text/javascript">
<!--

var oFCKeditor = new FCKeditor('FCKeditor1');
oFCKeditor.BasePath = "/FCKeditor/";
oFCKeditor.Create();
document.write("Welcome to my world!!!");

//-->
</script>

On 1/23/07, e.j.w.vanbloem@student.utwente.nl
<e....@student.utwente.nl> wrote:
> Hi
>
> I tried the code below, but when I put it in jetspeed it does not show the content of the script (not even the hello world). Can you give me an example that works?
>
> Regards
>
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
>     pageEncoding="ISO-8859-1"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <HTML>
>         <HEAD>
>         <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
>         <TITLE>UserPortlet</TITLE>
>         <script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
>         </HEAD>
>         <BODY>
> <br> test <br>
> <script language="javascript" type="text/javascript">
> var oFCKeditor = new FCKeditor('FCKeditor1');
> oFCKeditor.BasePath = "/FCKeditor/";
> oFCKeditor.Create();
> document.write("Welcome to my world!!!");
>
> </script>
> <%..................
>
>
> ________________________________
>
> Van: Martin Dulisch [mailto:mdulisch@gmail.com]
> Verzonden: di 23-1-2007 12:38
> Aan: Jetspeed Users List
> Onderwerp: Re: javascript in portlet.jsp
>
>
>
> Hi Erik,
>
> you can place a "script" tag in your portlet.jsp
>
> Martin
>
>
> 2007/1/23, e.j.w.vanbloem@student.utwente.nl <
> e.j.w.vanbloem@student.utwente.nl>:
> >
> > Hi,
> >
> > can someone tell me how to include javacript in my portlet.jsp?
> >
> > Regards
> >
> > Erik
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


RE: javascript in portlet.jsp

Posted by e....@student.utwente.nl.
Hi
 
I tried the code below, but when I put it in jetspeed it does not show the content of the script (not even the hello world). Can you give me an example that works? 
 
Regards
 
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
        <HEAD>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <TITLE>UserPortlet</TITLE>
        <script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
        </HEAD>
        <BODY>
<br> test <br>
<script language="javascript" type="text/javascript">
var oFCKeditor = new FCKeditor('FCKeditor1'); 
oFCKeditor.BasePath = "/FCKeditor/"; 
oFCKeditor.Create(); 
document.write("Welcome to my world!!!");

</script> 
<%..................
 

________________________________

Van: Martin Dulisch [mailto:mdulisch@gmail.com]
Verzonden: di 23-1-2007 12:38
Aan: Jetspeed Users List
Onderwerp: Re: javascript in portlet.jsp



Hi Erik,

you can place a "script" tag in your portlet.jsp

Martin


2007/1/23, e.j.w.vanbloem@student.utwente.nl <
e.j.w.vanbloem@student.utwente.nl>:
>
> Hi,
>
> can someone tell me how to include javacript in my portlet.jsp?
>
> Regards
>
> Erik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: javascript in portlet.jsp

Posted by Martin Dulisch <md...@gmail.com>.
Hi Erik,

you can place a "script" tag in your portlet.jsp

Martin


2007/1/23, e.j.w.vanbloem@student.utwente.nl <
e.j.w.vanbloem@student.utwente.nl>:
>
> Hi,
>
> can someone tell me how to include javacript in my portlet.jsp?
>
> Regards
>
> Erik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>