In this example I am going to show you how to add the dynamic HTML code into Document using javascript and PHP
<?php
$random_id = 125845465; // PUTTING SOME RANDOM ID YOU CAN USE YOURSELF.
$DYNAMIC_HTML = '<div>
<b>Sponsored Links</b>
<div>
<span><a style="font-size:12px;font-weight:bold;" href="http://www.ucoz.com/" rel="nofollow">Create a website for free - uCoz</a></span><br />
Build a website quickly and easily
Customizable templates and graphics
</div>
<div>
<span><a style="font-size:12px;font-weight:bold;" href="http://www.wordpressapi.com/files/domain_names/">$1.99 Domain Names</a></span><br />
With every new non-domain purchase thru <a href="http://www.wordpressapi.com/files/domain_names/" rel="nofollow">wordpressapi</a>, you get a domain name for only $1.99.
</div>
<div>
<span><a style="font-size:12px;font-weight:bold;" href="http://www.wordpressapi.com/files/" rel="nofollow">FREE Hosting!</a></span><br />
With every domain you register with <a href="http://www.wordpressapi.com/files/" rel="nofollow">wordpressapi</a> you get FREE hosting.
</div>
</div>';
$HTML = "var objHead = document.getElementsByTagName('head');
var objCSS = objHead[0].appendChild(document.createElement('link'));
objCSS.id = '.$random_id.';
objCSS.rel = 'stylesheet';
objCSS.href = 'http://YOURSITE/STYLE.css';
objCSS.type = 'text/css';";
$HTML .= '
var WORDPRESAPI_html_'.$random_id.' = document.createElement("div");
WORDPRESAPI_html_'.$random_id.'.id = "WORDPRESAPI_html_'.$random_id.'";
WORDPRESAPI_html_'.$random_id.'.style.position = "absolute";
WORDPRESAPI_html_'.$random_id.'.style.zIndex = "100";
WORDPRESAPI_html_'.$random_id.'.style.left = "0px";
WORDPRESAPI_html_'.$random_id.'.style.top = "0px";
WORDPRESAPI_html_'.$random_id.'.style.visibility = "hidden";
WORDPRESAPI_html_'.$random_id.'.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
WORDPRESAPI_html_'.$random_id.'.innerHTML = "'.addcslashes($DYNAMIC_HTML,"\\\'\"&\n\r<>").'";
document.body.appendChild(WORDPRESAPI_html_'.$random_id.');';
echo $HTML;
?>
In this code if you observe then following line is very important.
WORDPRESAPI_html_'.$uniqid.'.innerHTML = "'.addcslashes($HTML,"\\\'\"&\n\r<>").'";
Whenever you are using javascript and PHP both together then use following way to push your HTML in Dom.
Incoming search terms:
- appen html tags
- Php html
- javascript append html
- java script append file html code
- how to append using html
- how to append php in html
- how to append html Code using javascript
- append javascript php
- append html code using javascript
- php tutorial







Very nice blog post I love your blog carry on the good articles
Blogs for many purposes but without the plugins is like a car without weels. Thanks
I think this write up was probably a good kick off to a potential series of write ups about this topic. A lot of writers act like they comprehend what they’re writing about when it comes to this topic and most of the time, very few people actually get it. You seem to understand it though, so I think you should run with it. Thanks a lot!
Wow, this can be a good weblog you’ve obtained the following. Your post was actually helpful and educational, i can not wait to learn some much more. I started playing Farmville about three months a go and i cant believe how addictive it is
. I didn’t realise there was so considerably to understand about it either lol. I’ve invested ages looking for good tips and stuff and this can be good. I found an additional actually great website at Farmville Hintsthats has genuinely good points and cheats as well. Btw, if any person else has any good ideas then i wouldn’t thoughts hearing them also. Thanks a great deal for this.
I’m going to save this as inspiration and send visitors from my lens. I’ve just put up additional new ideas too, so I’ll add a hypelink to this article (if OK) on my site?
Thank you for such a fantastic blog. Where else could one get this kind of info written in such an incite full way? I have a presentation that I am just now working on, and I have been looking for such information.
This is really nice work! Thumbs up!
I would like to add your feed to my website, but cannot seem to find it. Do you have one available? I will be sure to visit in a couple days for your answer.
Yeah .. It’s good site, great work.
Great text and nice blog.
I rarely leave comments in blogs, mostly because I don’t feel the urge to do so. On the few occasions when I do feel the urge, I give up if there’s any kind of registration process involved. It’s just not worth the hassle. I did make an exception to post this comment, though, so I guess it’s not a hard and fast rule.
Very interesting. I like the way you write. Do you have an RSS feed?