Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2018
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JavaScript issues

    I am trying to build a portlet to display an existing web 2.0 application that uses ajax/javascript technology quite extensively. My code for the portlet (view.jsp) is something like this:

    <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
    <portlet:defineObjects />
    <script type="text/javascript" language="JavaScript" src="http://localhost:8900/myapp/jsapi"></script>
    <h1>Simple Viewer</h1>
    <div id="myDivContainer" style="border-width: 1px; border-style: solid;"></div>
    <script type="text/javascript" language="JavaScript">
    .....
    </script>


    I notice the code in the "script" tag does not even get invoked. Is there something wrong the way I am invoking javascript?
    I am using liferay-portal-5.2.3
    Appreciate all your help.

  2. #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    19,546
    Thanks
    221
    Thanked 2,712 Times in 2,686 Posts
    language = "Javascript" is long obsolete and redundant, but I don't think it is actually damaging. Perhaps your script needs to be at the end, right ahead of the </body> tag if it references code which has not yet been rendered.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  3. #3


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •