ID:1581490
 
Keywords: browser, click, link
(See the best response by Ter13.)
So im wonder how would i go and make a system where when i click on say a object in a grid or a button it would then display a link that i set for it in the browser

example: i click a technique and the lil browser box would show a picture of it from the link i set it to

Of an actual website or just a browser window?
like i wanna have it where i click on a button or whatever and the browser would show a preset link
Okay, I am not following you quite well so I'm going to explain this in two ways that I see fit.

Way One, displaying a link?
src<<browse("<script>window.location='http://www.example.com'</script>");

//and/or

src<<link("http://www.example.com");


or you mean you click the object and it shows stuff about the object?

obj/Click()
winset(usr,"windowname.controlname","parameter=value");
winset(usr,"main.objecttitle","text='Samples'"); //an example of the above.


Or do you mean that when you click on an object, it just pops up the object as a picture?

obj/Click()
usr<<browse("<img src='\icon[src.icon]'>") //i haven't used this method in a long time so I don't even know if this works or what it used to be.

//look up text-macros if the above doesn't work because i dont recall, honestly.


text macros are things like
\icon
\ref


and the last thing I can get out of your thing would be similar to Clicking a technique and its information/description appears?

So this method?
obj/techniques
var/html_info="";
sample_tech
html_info="<center><h1>Sample Tech</h1></center><hr>This is a sample technique.";
Click()
usr<<browse(src.html_info);
ok ill try to explain this best as possible you have a button you click it it activates a verb that tells a browser element within the same window to display a set link but yeh the first thing you said works
ok so is there anyway i can fix this up cause i got it where i click button it shows the picture from the link i put in but its like i got scroll bars and gaps around the picture and it really doesnt need to have it considering the browser boxes size is the same as the image so is there any kind of html code or something i can shove into this so i just have the image showing to the exact size it is to the browser
CSS, actually.

What's happening is that the page has margins. Set the margins to zero for the BODY element using CSS, and you won't have scrollbars and the like.

Insert this into the header of your HTML document:

<style type="text/css">
BODY {
margin: 0;
}
</style>
i have this
showlink()

src<<browse("<script>window.location='http://www.google/image/goku.jpg'</script>");


where do I put the code from above in since im just grabign a websites link and it isnt my own html file?
where do I put the code from above in since im just grabign a websites link and it isnt my own html file?

Uh... Don't do that?
im basically having it display a link of a picture for the techniques to save space instead of having loads of files everywhere to display pics or icons
Best response
That's fine. Just don't use someone else's server to display the images, use your own hosting space, and use a touch of javascript to do it:


When the browser is made visible, browse an html file to them containing this information:

<HTML>
<HEAD>
<STYLE type="text/css">
BODY {
margin: 0;
}

#bgimg {
display: none;
}
</STYLE>
</HEAD>
<BODY>
<IMG id="bgimg">
</BODY>
</HTML>

<script type="text/javascript">
var imgref = null;

function pageLoad()
{
imgref = document.getElementById("bgimg");
}

window.onload = pageLoad;

function changeImg(visibility,imgsrc)
{
if(imgref!=null)
{
imgref.src = imgsrc;
if(visibility==="1")
{
imgref.style.display="block";
}
else
{
imgref.style.display="none";
}
}
}
</SCRIPT>


You can change the image like so:

client
proc
changeImage(visibility,imgurl)
set waitfor = 0
src << output("[visibility];[imgurl]","browsername:changeImg")
^ what he said :D