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 3955238
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:12:20+00:00 2026-05-20T02:12:20+00:00

I am stumped here. I am working on switching my doctype to XHTML: <!DOCTYPE

  • 0

I am stumped here. I am working on switching my doctype to XHTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Since doing so, I’ve run into a validation issue. I’m using Dynamic Drive’s Ultimate Fade-in slideshow (found here: http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm) and feeding in all of my variables from a database. To make that work, I have to populate some javascript variables.

After I use the database to write out my javascript, I end up with the following:

<script type='text/javascript'>
var img1, img2, im3, img4, lnk1, lnk2, lnk3, lnk4, txt1, txt2, txt3, txt4;

img1 = "image1.jpg";
lnk1 = "/link1.php";
txt1 = "<font style='font-size: 14px;'><a href='/link1.php'>Article 1</a></font><br />Article 1 Content...";
img2 = "image2.jpg";
lnk2 = "/link2.php";
txt2 = "<font style='font-size: 14px;'><a href='/link2.php'>Article 2</a></font><br />Article 2 Content...";
img3 = "image3.jpg";
lnk3 = "/link3.php";
txt3 = "<font style='font-size: 14px;'><a href='/link3.php'>Article 3</a></font><br />Article 3 Content...";
img4 = "image4.jpg";
lnk4 = "/link4.php";
txt4 = "<font style='font-size: 14px;'><a href='/link4.php'>Article 4</a></font><br />Article 4 Content...";

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
    dimensions: [600, 400], //width/height of gallery in pixels. Should reflect dimensions of largest image
    imagearray: [
        [img1, lnk1, "", txt1],
        [img2, lnk2, "", txt2],
        [img3, lnk3, "", txt3],
        [img4, lnk4, "", txt4] // no trailing comma after very last image element!
    ],
    displaymode: {type:'auto', pause:5000, cycles:0, wraparound:false},
    persist: false, //remember last viewed slide and recall within same session?
    fadeduration: 500, //transition duration (milliseconds)
    descreveal: "always",
    togglerid: ""
})
</script>

I get a number of validation errors all pointing to the html code I am storing in the txt[x] variables.

Samples:
Line 239, Column 39: document type does not allow element “font” here

txt1 = "<font style='font-size: 14px;'><a href='/link1.php…

Line 239, Column 126: document type does not allow element “br” here

…Article 1</a></font><br />Article 1 Content …

Am I missing something obvious? Or is HTML text in a javascript variable not an option when it comes to being XHTML compliant?

  • 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-20T02:12:21+00:00Added an answer on May 20, 2026 at 2:12 am

    What validator are you using?

    The w3c validator does not ignore what’s inside the script tags, so if you have HTML in your script the validator will try to validate it as XHTML.

    Put your script into a separate file.

    Also, why are you worrying about validation if you are going to insert HTML4 tags via script?

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

Sidebar

Related Questions

This one has me stumped. Here are the relative bits of code: public AgencyDetails(Guid
I am completely stumped here. I have the following fragment shader working: varying lowp
Here's one that's got me stumped. Working in PHP5. I am building a store
Totally stumped here. Trying something pretty easy, but it's not working: $(input.input1, textarea.input1).focus(function(){ $(this).addClass(input2).removeClass(input1);
I am working on this site: http://www.problemio.com and I have very little clue about
I'm working on a Clojure algorithm to solve the problem posed here: http://spin.atomicobject.com/2011/05/31/use-clojure-to-move-drugs-a-programming-challenge/ and
Im a bit stumped here. Im working on building a binary heap class, modeled
I'm stumped here. I have an observable collection that holds business objects. I have
Okay, I'm stumped here. I have a control that is comprised of a table.
I am completely stumped. Here is my php (CodeIgniter) code: function mod() { $uid

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.