Welcome Guest, Not a member yet? Register   Sign In
onclick innerHTML to change this->load->view?
#9

[eluser]mvdg27[/eluser]
Basically the thing your doing wrong is that you're mixing php with javascript. What you should do is create ONE generic javascript funtion. No need for any php in your javascript. When you build your view, you can use php to somehow build in identifiers for you different albums. My preferred method is to simply make the urls point exactly to the content you want to be loaded.

Then the magic happens when you use your domready function to iterate over all the links. This ONE JAVASCRIPT ONLY function should read the urls, and add an html-request event to the link, instead of the default link behaviour.

My tip at this point: make sure you album works without any javascript. That is, when you click a link of your album, the page should reload and present you with the correct photo's in the album. Once that is working, take another look at my example in my previous post, to make the album work with dynamic javascript

The way your are creating javascript functions over-and-over with a php-loop is definately not the way to go.

Michiel


Messages In This Thread
onclick innerHTML to change this->load->view? - by El Forum - 05-17-2009, 03:02 AM
onclick innerHTML to change this->load->view? - by El Forum - 05-17-2009, 03:44 AM
onclick innerHTML to change this->load->view? - by El Forum - 05-17-2009, 05:08 AM
onclick innerHTML to change this->load->view? - by El Forum - 05-17-2009, 02:25 PM
onclick innerHTML to change this->load->view? - by El Forum - 05-17-2009, 04:57 PM
onclick innerHTML to change this->load->view? - by El Forum - 05-17-2009, 04:58 PM
onclick innerHTML to change this->load->view? - by El Forum - 05-18-2009, 12:32 AM
onclick innerHTML to change this->load->view? - by El Forum - 05-21-2009, 02:38 PM
onclick innerHTML to change this->load->view? - by El Forum - 05-21-2009, 02:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB