Alas I would have done that would it have been an option for the way
the navigation and loading times need to work. I've just found a
solution using the dynamic drive ajax script instead of mootools. It
does the same job but runs the fetched inline javascript without
complaints. Finally :) Thanks Thierry.


On Apr 9, 12:41 pm, Thierry bela nanga <[email protected]> wrote:
> ok,
> I suggest you load the gallery directly in your page, since it work, i don't
> want to make you confused anymore.
>
> you can also use tools like firebug to help you debug your js.
>
> On Thu, Apr 9, 2009 at 12:09 PM, Manohman <[email protected]> wrote:
>
> > I'm not sure if I can explain my problem any further because when you
> > wrote that 'the error comes from the script eval'ed by mootools' I
> > thought I'd already covered that when I wrote
>
> > '- I am aware - due to there being no problems when I remove the
> > javascript from the retrieved content html - that it is the executed
> > javascript in the retrieved html that is causing the errors.
> > Unfortunately the gallery needs the javascript there. '
>
> > I left out the point that the script was being evaluated by mootools,
> > but this was a given. So I'm not sure how to progress when you suggest
> > an idea that sounds like something I'd already covered. I'm not
> > particularly wonderful at javascript though so I imagine it's my lack
> > of experience that's causing me the confusion moreso than your advice.
> > I know it's always difficult when someone with experience deals with
> > someone relatively unexperienced so thanks again for all your
> > patience. I don't want to run you in circles so I should probably
> > leave the problem here and look for alternative solutions. Thanks
> > Thierry. I'll also try the try/catch in the script tag again, though I
> > am as confused as ever as to why I was suggested to try it, then told
> > it wasn't suitable because the response was html, and now to try it
> > again (that's how my confused head interpreted what you said). Perhaps
> > you meant try a try/catch that has different code to your eval
> > (respone) from earlier. I'll give that a go.
>
> > On Apr 9, 10:19 am, Thierry bela nanga <[email protected]> wrote:
> > > my apologizes if you are confused,
> > > I didn't looked carefully at your code the first time,
>
> > > if I suggested you eval'ed the response it is because i taught it was js.
>
> > > and i'm still telling you, the error comes from the script eval'ed by
> > > mootools. first check all the required js are loaded, and all vars are
> > > defined before you use them.
>
> > > you can use try/catch in the script tag in order to check where the error
> > > occurs.
>
> > > On Thu, Apr 9, 2009 at 9:34 AM, Manohman <[email protected]> wrote:
>
> > > > And just to be clearer when I said:
>
> > > > " Ultimately, my confusion lies in the fact that the javascript
> > > > executes
> > > > perfectly and the gallery works if all the html is on one page but if
> > > > a part of the html is retrieved by ajax (and it is the exact same
> > > > javascript code on the retrieved html page), it refuses to work with
> > > > evalScripts set to true. I cannot understand why. "
>
> > > > I'm aware that the only difference between the two situations is that
> > > > mootools request is being used in the second scenario to fetch the
> > > > code, so the problem must be with that. However, mootools request is
> > > > intended to fetch html and execute javascript, including inline
> > > > javascript contained in html. Therefore I don't understand the errors
> > > > that occur, which seem to boil down to a conflict between mootools
> > > > request and the jdgallery.js code.
>
> > > > On Apr 8, 8:51 pm, Manohman <[email protected]> wrote:
> > > > > I think we are misunderstanding eachother. Apologies as I don't mean
> > > > > to test your patience, you've been very helpful.
>
> > > > > To confirm what I understand:
>
> > > > > - I am aware of mootools trying to execute any javascript in <script>
> > > > > tags on the retrieved content when evalScripts is true. I set
> > > > > evalScripts to true deliberately to make this happen as the gallery
> > > > > recommends an inline javascript just before where a jdgallery is
> > > > > placed.
> > > > > - I am aware - due to there being no problems when I remove the
> > > > > javascript from the retrieved content html - that it is the executed
> > > > > javascript in the retrieved html that is causing the errors.
> > > > > Unfortunately the gallery needs the javascript there.
>
> > > > > - I still do not understand your use of the word 'should'. To me this
> > > > > suggests that something is not in place and should be in place. As
> > far
> > > > > as I aware, the code that you said I should use ('I think your code
> > > > > should be...') is what I already have. Or else you're confirming that
> > > > > that piece of the code looks accurate and should remain?
>
> > > > > - I also do not understand why you now say I have no reason to eval
> > > > > the response when an earlier piece of code you suggested I try had
> > eval
> > > > > (response)?
>
> > > > > Ultimately, my confusion lies in the fact that the javascript
> > executes
> > > > > perfectly and the gallery works if all the html is on one page but if
> > > > > a part of the html is retrieved by ajax (and it is the exact same
> > > > > javascript code on the retrieved html page), it refuses to work with
> > > > > evalScripts set to true. I cannot understand why.
>
> > > > > Thanks
>
> > > > > On Apr 8, 7:42 pm, Thierry bela nanga <[email protected]> wrote:
>
> > > > > > what i said is,
> > > > > > you have no reason to eval the response since it is not javascript.
> > the
> > > > eval
> > > > > > in onComplete is not necessary.
>
> > > > > > but since you set evalScripts  to true, mootools will try to
> > execute
> > > > scripts
> > > > > > in the response (I mean the content on any <script> tag).
>
> > > > > > this should be the reason why you have errors.
>
> > > > > > On Wed, Apr 8, 2009 at 7:30 PM, Manohman <[email protected]>
> > > > wrote:
>
> > > > > > > Apologies, I thought I'd listed every angle I've tested but I
> > forgot
> > > > > > > to mention one. I ran the page and requested the content
> > successfully
> > > > > > > when the javascript on the content page was removed. I had
> > already
> > > > > > > narrowed it down to that but didn't word that correctly.
>
> > > > > > > I also noticed that
>
> > > > > > > - the javascript runs perfectly if it's on the parent page and
> > not
> > > > > > > requested as content.
> > > > > > > - some other javascripts run fine on the requested content when
> > > > > > > testing, meaning the evalscripts is doing its job
> > > > > > > - the mootools request and jdgallery both run from mootools so I
> > > > > > > thought I'd be easing conflicts by using this combination.
>
> > > > > > > 'I think your code should be
> > > > > > > onComplete: function(response) { $('page7content').set('html',
> > > > > > > response); }
> > > > > > > since reponse should be in html, '
>
> > > > > > > If I'm not misinterpreting what you mean, I believe that's the
> > way
> > > > the
> > > > > > > code is already and I can't see a change?
>
> > > > > > > Thanks.
>
> > > > > > > On Apr 8, 5:21 pm, Thierry bela nanga <[email protected]> wrote:
> > > > > > > > I see,
>
> > > > > > > > I think your code should be
>
> > > > > > > > onComplete: function(response) { $('page7content').set('html',
> > > > response);
> > > > > > > }
>
> > > > > > > > since reponse should be in html,
>
> > > > > > > > you have set
>
> > > > > > > > evalScripts to  true, this means mootools will run any
> > javascript
> > > > in the
> > > > > > > > response, and what I say is that the error message you have
> > come
> > > > from the
> > > > > > > js
> > > > > > > > in the response.
>
> > > > > > > > On Wed, Apr 8, 2009 at 4:48 PM, Manohman <
> > [email protected]>
> > > > wrote:
>
> > > > > > > > > Sure you can, is there something I have to paste? I'm unsure
> > > > because I
> > > > > > > > > couldn't catch it with your code.
>
> > > > > > > > > On Apr 8, 4:41 pm, Thierry bela nanga <[email protected]>
> > wrote:
> > > > > > > > > > Ooops, sorry
>
> > > > > > > > > > can I take a look at the response ?
>
> > > > > > > > > > On Wed, Apr 8, 2009 at 4:28 PM, Manohman <
> > > > [email protected]>
> > > > > > > wrote:
>
> > > > > > > > > > > Thanks again Thierry, I appreciate the help. I'm not the
> > best
> > > > at
> > > > > > > this
> > > > > > > > > > > (hence why I'm probably stuck in the first place) but
> > it's
> > > > > > > returning a
> > > > > > > > > > > 'response not defined' when I insert the code. I imagine
> > I
> > > > might
> > > > > > > have
> > > > > > > > > > > put it in the wrong place but I tried to put it where I
> > > > thought it
> > > > > > > > > > > might catch the response.
>
> > > > > > > > > > >http://www.copypastecode.com/codes/view/4623
>
> > > > > > > > > > > On Apr 8, 4:01 pm, Thierry bela nanga <[email protected]>
> > > > wrote:
> > > > > > > > > > > > the problem probably come from the eval,
> > > > > > > > > > > > you can test with a try/catch to see where is the
> > problem
>
> > > > > > > > > > > > try {
>
> > > > > > > > > > > >   eval(reponse);
>
> > > > > > > > > > > > }
>
> > > > > > > > > > > > catch(e) {
>
> > > > > > > > > > > >  alert([e.message, e.fileName,
> > e.lineNumber].join('\n'));
>
> > > > > > > > > > > > }
> > > > > > > > > > > > On Wed, Apr 8, 2009 at 3:49 PM, Manohman <
> > > > [email protected]>
> > > > > > > > > wrote:
>
> > > > > > > > > > > > > Thanks Thierry. I can't see a problem with it so far.
> > > > jdGallery
> > > > > > > is
> > > > > > > > > > > > > already running on the parent page and has a seperate
> > > > gallery
> > > > > > > > > running
> > > > > > > > > > > > > successfully. It's also been set up correctly to
> > allow 2
> > > > > > > distinct
> > > > > > > > > > > > > jdgallerys to run on the same page. Even though
> > > > jd.gallery.js
> > > > > > > is
> > > > > > > > > > > > > already running on the parent page, I tried pasting
> > in
> > > > the code
> > > > > > > > > into
> > > > > > > > > > > > > script tags on the requested content page to allow
> > > > evalscript
> > > > > > > to
> > > > > > > > > run
> > > > > > > > > > > > > through it aswell, which made no difference. I didn't
> > > > think it
> > > > > > > > > would
> > > > > > > > > > > > > if it's already running before the content's
> > requested.
>
> > > > > > > > > > > > > Here is the content that's being requested:
>
> ...
>
> read more »

Reply via email to