Welcome Guest, Not a member yet? Register   Sign In
Fatal error in relation to Javascript
#11

[eluser]russ_kern[/eluser]
OK... I have it dropping content into the DIV tag... but what it is dropping is is the ENTIRE page that I'm currently viewing - not the "sell_sheet_builder/contenta/?" page which amounts to a few drop downs or text area or whatever is defined based on their selection...

Any idea why?

I suspect it has to do with my links in the html of the view file

Code:
<a href="[removed]loadContenta(1);" class="build">PCMO Product</a>
<a href="[removed]loadContenta(2);" class="build">HDEO Product</a>
<a href="[removed]loadContenta(3);" class="build">Industrial Product</a>
<a href="[removed]loadContenta(4);" class="build">Aviation Product</a>
<a href="[removed]loadContenta(5);" class="build">Custom Content</a>
<a href="[removed]loadContenta(6);" class="build">Library Content</a>  
<a href="[removed]loadContenta(7);" class="build">Promotions</a>
<a href="[removed]loadContenta(8);" class="build">Kendall Locator</a>
            
<div id="regiona" style="margin-top:24px;clear:both;display:block; ">
    --
</div>
#12

[eluser]Mark Croxton[/eluser]
Classic error - you need to return false from the js function to prevent your link being followed Smile
#13

[eluser]russ_kern[/eluser]
OK... First... I'm not intimately familiar with Javascript... although I'm learning it...

Where is it best to return false from?
I have tried a few different things... either they don't affect the page loading or nothing happens at all..

2 things I've tried (among others):

first was to change my links to an "onclick" event with return false tagged on the end...

Second was..

Code:
<a href="[removed]loadContenta(1); return false;" class="build">PCMO Product</a>

the first had no effect on the previous behaviour, the second - nothing happened at all.

Your help is really appreciated... I know this isn't a Javascript forum.

Russ
#14

[eluser]Mark Croxton[/eluser]
You need to use the onclick event handler not the href of your link.

href="#" onclick="myfunction();return false;"
#15

[eluser]russ_kern[/eluser]
I had tried that... a regular <href="#"> with:

onclick="loadContenta(1); return false;"

would that be correct?

This still returns the entire current page in my div tag for me...
#16

[eluser]Mark Croxton[/eluser]
yep should work
#17

[eluser]russ_kern[/eluser]
[quote author="Mark Croxton" date="1282167868"]yep should work[/quote]

This still returns the entire current page in my div tag for me…

I'll keep digging... thanks for the help...
#18

[eluser]russ_kern[/eluser]
[quote author="Mark Croxton" date="1282167868"]yep should work[/quote]

This still returns the entire current page in my div tag for me… I'll keep diggin'... thanks for the help Mark.

Russ
#19

[eluser]danmontgomery[/eluser]
Sure it's not being cached?
#20

[eluser]russ_kern[/eluser]
Positive... tried multiple browsers & Platforms (javescript I know can behave differently between OS's)

R




Theme © iAndrew 2016 - Forum software by © MyBB