Please respect other members. Please do not post links or information about hacking/warez/cheats.
Read the rules of these forums as we rarely warn before banning. Lost or need RSS check the forum map.

Latest News

Quick Nav
Navigation
Diablo IncGamers
Diablo Wiki
Gallery
Donate/Subscribe
Follow us on Twitter
Diablo 3 Game Info
Basics
Classes
Items
Combat
Monsters
Interface
A-Z Index
Diablo 2 Game Info
Basics
Classes
Items
Runes
Monsters
A-Z Index
Strategies
Diablo I/Hellfire
Forums
Community
Trading
Strategy


Donate and get extra forum perks
Support diii.net

Go Back   Diablo 3 & Diablo 2 Forums > DIII.Net & Diablo Wiki > Diablo Wiki
Register Blogs FAQ Calendar Mark Forums Read

Diablo Wiki Discuss wiki projects, make suggestions and ask questions for Diablo Wiki

Reply
 
Thread Tools Display Modes
Old 30-05-2009, 12:22   #1
pixartist
DiabloII.Net Member
 
Join Date: May 2009
Location: Hamburg
Posts: 1
Embed d3 items

I recently started creating a diablo-fansite at d3base.de. It's mainly about items, and thus the first thing i created was an item-database that let's you easily configure different stats/qualities/types and subtypes of items. Well and I created a way to embed those items:
this has to go into the head of the site:
Code:
<script type="text/javascript">
//id: id of the item in the database
//taget: id of the target container in the document (must be unique)
function loadd3item(id, target){
	//what this does is, it actually dynamicly creates a new javascript tag which then loads it's own source from my site..it also passes the name of the target div, so the content can write itself into it!
	var fileref=document.createElement('script')
	fileref.setAttribute("type","text/javascript")
	fileref.setAttribute("src", "http://www.d3base.de/viewitem_embed.php?id=" + id + "&" + "obj=" + target)
	//meep meep
	if (typeof fileref!="undefined")
		document.getElementsByTagName("head")[0].appendChild(fileref)
//d3base.de - Finn Sohst
}

</script>
and now you can embed items with:
Code:
<div id="test"></div>
<script  type="text/javascript">loadd3item(15,"test")</script>
while the div-id has to be unique of course and the "15" resembles the id of the item in the database...

perhaps this could be useful in the wiki ?!
pixartist is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:53.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Advertisement System V2.5 By   Branden