/    Sign up×
Community /Pin to ProfileBookmark

addind a possibility to click on the pic’s

I can seem to add a possibility to click on the images show i can open a new window to show a bigger picture.
See code below.

<html>
<head>
<title>Sample code – Traversing an HTML Table with JavaScript and DOM Interfaces</title>
<script>
function start(textfile) {

var telcol=0
var fso = new ActiveXObject (“Scripting.FileSystemObject”);
var pad=unescape (window.location.pathname);

var n=pad.lastIndexOf(““);
var bestand,lijn;

pad=pad.substring(1,n+1);
pad=pad + textfile;
bestand=fso.OpenTextFile(pad,1,false);
var mybody=document.getElementsByTagName(“body”).item(0);
mytable = document.createElement(“TABLE”);
mytablebody = document.createElement(“TBODY”);
mytable.style.border = “1”;

mytable.style.width = “100%”;

mytable.style.height = “100%”

mytable.align = “center”

for(j=0;j<3;j++) {
mycurrent_row=document.createElement(“TR”);
for(i=0;i<3;i++) {

lijn=bestand.ReadLine();

mycurrent_cell=document.createElement(“TD”);
mycurrent_cell.align=”center”;

my_img=document.createElement(“IMG”);
my_img.src= telcol + “.jpg”;
my_img.style.heigth = “30px”;
my_img.style.width = “30px”;
mycurrent_cell.appendChild(my_img);
mycurrent_cell.appendChild(document.createElement(‘br’));

currenttext=document.createTextNode(lijn);
mycurrent_cell.appendChild(currenttext);
mycurrent_row.appendChild(mycurrent_cell);
telcol++;
}
mytablebody.appendChild(mycurrent_row);
}
mytable.appendChild(mytablebody);
mybody.appendChild(mytable);
mytable.setAttribute(“border”,”2″);
}

</script>
</head>
<body onload=”start(‘omschrijving.txt’)”>
TEST
</body>
</html>

to post a comment
JavaScript

10 Comments(s)

Copy linkTweet thisAlerts:
@olafApr 12.2005 — I'm not sure if it's possible to you, but I do the check with 1 or 2 rows in PHP
Copy linkTweet thisAlerts:
@David_HarrisonApr 12.2005 — I'm not sure what browsers with pop-up blockers would think of this, if they don't allow the pop-up then it would be neccessary to create a link and put the image in that.my_img=document.createElement("IMG");
my_img.src= telcol + ".jpg";
my_img.style.heigth = "30px";
my_img.style.width = "30px";
[color=red]my_img.onclick = function(){
window.open(this.src);
}[/color]
Copy linkTweet thisAlerts:
@CGGauthorApr 12.2005 — that's what I was looking for, thnx a lot
Copy linkTweet thisAlerts:
@David_HarrisonApr 12.2005 — Happy to help. ?

But you know, without JavaScript, nothing will be displayed. [url=http://www.thecounter.com/stats/2005/February/javas.php]10%[/url] of people browse without JavaScript, including me! :eek:
Copy linkTweet thisAlerts:
@olafApr 12.2005 — 10 % is a lot... I think you surf without cookies too?
Copy linkTweet thisAlerts:
@David_HarrisonApr 12.2005 — No, I have cookies enabled, it's how I stay logged into the webdev forums.
Copy linkTweet thisAlerts:
@olafApr 12.2005 — It was just a joke, right somtimes it's beter to disable JS but I like to enjoy a whole webpage ?
Copy linkTweet thisAlerts:
@David_HarrisonApr 12.2005 — It was just a joke, right somtimes it's beter to disable JS but I like to enjoy a whole webpage ?[/QUOTE]If the webpage is made correctly, you still can.
Copy linkTweet thisAlerts:
@olafApr 12.2005 — hehe, tell this the webmasters...

:o
Copy linkTweet thisAlerts:
@felgallApr 12.2005 — If a web page doesn't function correctly with Javascript disabled then that page wasn't created by a webMASTER, it was created by a webNOVICE.

The only exception to this would be web pages about Javascript where it is reasonable to assume that the person viewing the page should have Javascript enabled.
×

Success!

Help @CGG 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 5.20,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...