Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
mzanime.com #1
Detect current page using JS
Hi all, I would've figured this out myself, but I'm stumped on this.... why
doesnt this work?
<script type="text/javascript">
document.write("[BULLET]");
document.write(" [LI]<a href='index.html' " +
if(window.location.href.match("index.html")) { document.write(" class='x'"); }
+ ">link</a></li>");
document.write(" [LI]<a href='links.htm'>link</a></li>");
document.write(" [LI]<a href='contact.htm'>link</a></li>");
document.write("[/BULLET]");
</script>
mzanime.com Guest
-
Detect bottom of page and swap image
I want to detect when the user has scrolled to the bottom of the page and then swap a 'down' arrow graphic for an 'up' arrow graphic that links to... -
Detect leaving page
Looking for a method to detect when the user presses the "Back" button and also Alt+> Thanks for any insight! Kevin -
trying to detect mousemovement to move to next page,like a screensaver
Hi, I'm a beginning flash user. First time poster. I found this thread. It is very close to the challenge I am having with my project. I am having... -
detect change of remote page
hi everyone, i have some links on my site, i need to be absolutely sure that the html has not been modified, even one character. i would rather... -
redirect to another page based on text in the URL of the current page
Hi JPElectron, You were looking good until you got to the code. You're trying to use client-side code for your redirects, when you should be... -
Deaf Web Designer #2
Re: Detect current page using JS
please post a URL link to your example page you are working with. IT is more than just javascript by itself, it needs to show html source and see how those two work together.
Deaf Web Designer Guest
-
Deaf Web Designer #3
Re: Detect current page using JS
I happen to notice two different html extensions as in ".html" and ".htm" without letter of a 'l'.
Deaf Web Designer Guest
-
mzanime.com #4
Re: Detect current page using JS
Here's the code. For some reason, it doesn't even render anything on screen! I
really hope there are a few javascript experts in the house.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
.x { font-weight:bold; }
</style>
</head>
<body>
<div id="leftnav">
<script type="text/javascript">
document.write("[BULLET]");
document.write(" [LI]<a href='index.html' " +
if(window.location.href.match("index.html")) { document.write(" class='x'"); }
+ ">link</a></li>");
document.write(" [LI]<a href='links.htm'>link</a></li>");
document.write(" [LI]<a href='contact.htm'>link</a></li>");
document.write("[/BULLET]");
</script>
</div>
</body>
</html>
mzanime.com Guest
-
mzanime.com #5
Re: Detect current page using JS
Here's the code. For some reason, it doesn't even render anything on screen! I
really hope there are a few javascript experts in the house.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
.x { font-weight:bold; }
</style>
</head>
<body>
<div id="leftnav">
<script type="text/javascript">
document.write("[BULLET]");
document.write(" [LI]<a href='index.html' " +
if(window.location.href.match("index.html")) { document.write(" class='x'"); }
+ ">link</a></li>");
document.write(" [LI]<a href='links.htm'>link</a></li>");
document.write(" [LI]<a href='contact.htm'>link</a></li>");
document.write("[/BULLET]");
</script>
</div>
</body>
</html>
mzanime.com Guest
-
mzanime.com #6
Re: Detect current page using JS
No, its pobably not a good idea to do so, but in meantime I'm working locally
and I've got no IIS, or PHP engine installed on my notebook, so I'm going to
work with what I've got. I'll most likely change it to PHP in the future, but
in the meantime- I'm trying to learn a few things about how javascript works.
I don't see any reason why this code isn't working.... if no one has any
ideas, I'm going to go hunting for a Javascript forum.
mzanime.com Guest
-
Deaf Web Designer #7
Re: Detect current page using JS
Michael,
Ah, I see. If you didn't know about this excellent book about PHP working well
with Dreamweaver. The book is called "PHP for Dreamweaver 8" who wrote by David
Powers. I recommend that you consider to buy this book and use it as a
reference. This book, practically cover fundamentals of how PHP works, even
covers on how to set up PHP, Apache and few other great topics discussed by
Author David Powers. I don't think this book won't disappoint you, Michael.
As for javascript aspect, I like javascript, but with extreme cautious
approach, though. It is not user friendly and I don't think it is very
'accessible-friendly' pretty much. That is why I mention that earlier, too.
Deaf Web Designer Guest
-
mzanime.com #8
Re: Detect current page using JS
I've decided to just go with PHP. Sure would be nice to know why this don't work though.... if someone knows, please email me: mike (at) cssdreams (dot) com
*closes thread*
mzanime.com Guest
-
Deaf Web Designer #9
Re: Detect current page using JS
Michael, let us or me know if you need some help with PHP and all that. Having
said that, please refer to that book I was talking about. I don't think you
won't be disappointed, Michael.
Once you get that book, be sure to refer to the author's website for updated
information due to a little small hiccups associated with DW8 v. 8.0.2 Updater
issues. Having said that, so that you know what's up with the latest, updated
information and additional, new information released from the author through
his website blog. If for some reason, you could not locate this author's
website, please do let me know.
Cheers, DWD
Deaf Web Designer Guest



Reply With Quote

