/    Sign up×
Community /Pin to ProfileBookmark

Writing Dynamic Content

Hi,

Here’s what I’ve been trying a lot to find but to no avail:
a simple text field and submit button that lets users insert an embedding (HTML/CSS/JavaScript codes) to display on the same frame.

I’d like something like this:
[url]http://www.howtocreate.co.uk/tutorials/jsexamples/dywrite.html[/url]

Unfortunately it doesn’t run any code. For example:

[CODE]<html>
<head>
<script type=”text/javascript”>
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById(‘txt’).innerHTML=h+”:”+m+”:”+s;
t=setTimeout(‘startTime()’,500);
}

function checkTime(i)
{
if (i<10)
{
i=”0″ + i;
}
return i;
}
</script>
</head>

<body onload=”startTime()”>
<div id=”txt”></div>
</body>
</html>[/CODE]

Or the text marquee code on the following tutorial:
[URL=”http://www.dynamicdrive.com/dynamicindex2/cmarquee.htm”]http://www.dynamicdrive.com/dynamicindex2/cmarquee.htm[/URL]

Your help is greatly appreciated!
Regards
Rain Lover

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@WesterlyJun 13.2010 — Rain:

See attached. Edit the .....config.js file to suit.

Regarding dynamic content, document.write is obsolete.

Do you know that nothing created dynamically by a user will be permanent? It's gone as soon as they leave the page, and no one else will be able to see it while it's there. It only exists in the user's browser.

Instead of posting a link to something, explain exactly what you want the user to be able to do, and why.

[upl-file uuid=59b6fba3-8ac5-47ee-8c92-5a9635c28ad6 size=4kB]R_To_L_Text-Link_Scroller.zip[/upl-file]
Copy linkTweet thisAlerts:
@Rain_LoverauthorJun 13.2010 — Dear Westerly,

Thanks for the answer, but I don't want a text scroller. As you can see on my post I 'd like something like a text area and submit button in which you can embed different codes to display -- something like this:

http://www.howtocreate.co.uk/tutorials/jsexamples/dywrite.html

But the problem is the above example doesn't support [I]any [/I]code. To see what I mean try the code on my first post.
Copy linkTweet thisAlerts:
@KorJun 14.2010 — document.write() is not a dynamic method. It will overwrite the document eachtime when it is called. Wouldn't be simpler to tell us what in fact you want? Describe your aim, please. Forget about the codes.
×

Success!

Help @Rain_Lover spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 11.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @bahaedd,
tipped: article
amount: 1000 SATS,

tipper: @Balmasexy,
tipped: article
amount: 1000 SATS,

tipper: @mbsaad,
tipped: article
amount: 1000 SATS,
)...