Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6184633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:34:14+00:00 2026-05-24T01:34:14+00:00

I have a javascript widget that can be inserted on an a plain-old html

  • 0

I have a javascript widget that can be inserted on an a plain-old html page like this:

<html>
    <head>
        <script type='text/javascript' src="http://example.com/widget.js"></script>
    </head>
    <body>
        <script type='text/javascript'>
            //<![CDATA[            
            try{ widget_constructor('key',500,400); }
            catch(e){ alert(e.message); }
            //]]>
        </script>
    </body>
</html>

I would like to insert this javascript on one page of a Drupal 6 site (not every page).

This is what I have tried so far to get the script tag in the HEAD:

  • I set the Full HTML input format to allow php.
  • For the Drupal page, I set the input format to Full HTML

I then added this to the top of the body of my Drupal page:

<?php 
  drupal_set_html_head('<script type="text/javascript" src="http://example.com/widget.js"> </script>'); 
?>

But Drupal doesn’t parse the php and instead prints this at the top of the page:

<?php drupal_set_html_head(''); ?> 

Any suggestions as to how I can do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:34:15+00:00Added an answer on May 24, 2026 at 1:34 am

    After writing that all out, I figured out the problem…

    The full html input format has an HTML corrector filter turned on by default, and that filter appears to have caused problems with the PHP code. Reordering the filters to put the PHP evaluator first fixed the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a widget-like block of HTML+JavaScript that people can copy/paste into their HTML-page
I have a JavaScript widget that is hosted on websites. This widget tracks state
I have a JavaScript widget (a piece of embedded JS and HTML code) that's
We have a UI widget on our main UI that uses JavaScript to respond
I have javascript code embedded inside a html template file. When I load this
I have javascript string variable with var sttr=We prefer questions that can be answered
I have a calculator widget ( jsfiddle ) that uses javascript's eval() function to
I have an HTML editor widget that I want to appear within an absolutely
I've got a javascript widget on my page that outputs times for Sunrise and
http://jsfiddle.net/4B2Bc/1/ <- the link to the widget I have this javascript widget, which I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.