/    Sign up×
Community /Pin to ProfileBookmark

Seems I recall awhile back that there was an HTML equivelent of If Then Else, can this be used as well, to verify that something exists somewhere, and either display the item or a message if it does not…?
What would the syntax be…?

to post a comment
HTML

6 Comments(s)

Copy linkTweet thisAlerts:
@NicodemasMar 17.2003 — In all my years I've never heard of such a thing.
Copy linkTweet thisAlerts:
@AdamGundryMar 17.2003 — Yes, HTML is a markup language and as such does not provide support for logical tests such as If/Then or other programming constructs. You can get such an effect with JavaScript, however:
[CODE]
<script type="text/javascript">
if (condition){
document.write('Condition is true!');
} else {
document.write('Condition is false!');
}
</script>
[/CODE]


If you could explain what you mean by "verify that something exists somewhere" I could probably write a script to do what you want. Remember, however, this can cause accessibility issues, as 10% of users do not have JavaScript functional.

Adam
Copy linkTweet thisAlerts:
@JerryWMacauthorMar 17.2003 — I have a page of 950 more or less Links around the net, What I want is a javascript that can verify each link, then show next to the link, whether the site is active or not, forbidden etc. etc.

What I am thinking about now, is a js file that manipulates images, then I will just access a linked image on the different links locations, if the link is there, as in a logo or what, then it will show next to the link on my links page, however, if the link is NOT there, then I want it to show error message, forbidden access, not at location, deleted, etc.

I can run a seperate program that shows all this info, and also shows active links, error messages but does NOt place these on my page. I want the page self contained, without the external help...

Yep, certainly, I know, without any doubt, there will always be people out there that refuse to use Java script. but appears this is the only active method to verify links accessability.? ?
Copy linkTweet thisAlerts:
@JerryWMacauthorMar 17.2003 —  <script type="text/javascript">

if (condition){

document.write('Condition is true!');

} else {

document.write('Condition is false!');

}

</script>
[/QUOTE]

This is what you said, ok, going form that, I could plug in the html location link of the image as a variable, and call it from the link line. showing the image error message if not available.

Ok, sounds like it might work...

I will work on this more tomorrow. That is a lot of links to work with and will take at least two days at my snails pace to edit..

But then most of it can be automated... God I love copy and paste programs.... ? ? ? ? ?
Copy linkTweet thisAlerts:
@NedalsMar 17.2003 — I can run a seperate program that shows all this info, and also shows active links, error messages but does NOt place these on my page[/quote]
You've got my interest.

How do you do that? Is this currently done using a server-side script? I cannot, off hand, think of a way to do this in a [i]self contained page, without the external help...[/i], but you never know.
Copy linkTweet thisAlerts:
@JerryWMacauthorMar 17.2003 — At this moment, I do not know, but in a few days after it has coooked a bit in my head, I will have something that WILL work...

I do KNOW it can work, and when it comes down to it, appears that java is best bet.

I just need to go back and relearn java script so that it is fresh in my head again
×

Success!

Help @JerryWMac 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.27,
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,
)...