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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:52:24+00:00 2026-06-15T16:52:24+00:00

See the source of http://marakana.com/s/post/1096/samples/try6.htm It defines a function and calls it on load

  • 0

See the source of http://marakana.com/s/post/1096/samples/try6.htm
It defines a function and calls it on load of document. (Which is the final step of this tutorial)

I tried to put it into a seperate JS file.
Runs correctly only if I call onload both in JS and in HTML.
But not only body onload or only from JS. I guess I am doing something wrong.
So, following works:

<head>
<script src="Scripts/makeWYSIWYG.js" type="text/javascript"/>
<script type="text/javascript">
            window.onload = function () {
               makeWYSIWYG(document.getElementById('editor'));
            };
</script>
</head>
<body onload="makeWYSIWYG(document.getElementById('editor'));">

Why do I need to call the function twice?

I only have the function definition in “Scripts/makeWYSIWYG.js”
function makeWYSIWYG(editor) {
…
return editor;
};

Thanks,

  • 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-06-15T16:52:25+00:00Added an answer on June 15, 2026 at 4:52 pm

    The problem was actually the closing tag, “/>”, here:

    <script src="Scripts/makeWYSIWYG.js" type="text/javascript"/>
    

    I should have written:

    <script src="Scripts/makeWYSIWYG.js" type="text/javascript"> </script>
    

    I guess the second script was helping the tag to be closed and making it run…

    More info here: Why don't self-closing script tags work?

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

Sidebar

Related Questions

Say I'm at the url http://mysite.com/form.html . When viewing source, I see <form method=post
The page is: http://item.taobao.com/item.htm?id=13015989524 you can see its source code. In its source code
If we look at the latest jQuery source at http://code.jquery.com/jquery-latest.js we see the following:
if you go here: http://whois.domaintools.com/iconplc.com and view the source why can't you see the
I am looking at the calc source here http://epaperpress.com/lexandyacc/ I see theses lines in
See the fiddle: http://jsfiddle.net/stefek99/9m5NZ/1/ Get the source: http://pastie.org/3654715 Chrome 17 : just works. IE
First see my Source Code: WebClient client = new WebClient(); String url = http://localhost;
If you view source on http://seeitornot.co/prometheus/771228969 , you'll see html in the including the
Please see my source code at: http://jsfiddle.net/rAmSG/9/ The blue item should be dropped at
I am specifically intertested in #270. You can see it here: http://railscasts.com/episodes/270-authentication-in-rails-3-1 I've downloaded

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.