[eluser]Xeoncross[/eluser]
[quote author="Nick Husher" date="1229385522"]
What you want to be doing is:
Code:
// myview.php
<a id="click-me" href="http://example.com/mycontroller/myfunction">Modal</a>
Code:
// myscript.js
YAHOO.util.Event.addListener("click", "click-me", function(eventObject) {
eventObject.preventDefault();
// present some information with javascript
});
[/quote]
Yes, I am glad you mentioned that. I just wanted to keep my example simple so people would understand. Your site should work whether that sweet-looking JS modal pops up or not. For example, my blog sends ALL requests as AJAX requests unless you are the GoogleBot or a user without JS - then it downgrades and works like a normal site as Nick showed.
JS should ONLY enhance your site - it shouldn't be required to run it!