php script type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pradeepjain
    Contributor
    • Jul 2007
    • 563

    #1

    php script type

    <script src="getimages. php"></script>
    i am using this to run a script but dring validation it gives error as "

    Line 285, Column 51: required attribute "type" not specified.

    <div class="content" ><script src="getimages. php"></script>



    The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

    Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>."

    is there any solution for this
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Along with this, provide header
    Code:
    header("content-type:text/javascript");
    in the starting of the file.

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Like the validation says, you should include a type parameter in the <script> tag.
      Like:
      [code=html]<script src="getimages. php" type="text/javascript"></script> [/code]
      This should indicate the type of script your PHP code outputs.
      PHP is executed server-side, and only it's output is read on the client side.

      Comment

      Working...