JQuery ready function location

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
jenn.bohm
Ensign (ENS)
Ensign (ENS)
Posts: 2
Joined: Tue May 11, 2010 4:09 pm

JQuery ready function location

Post by jenn.bohm » Wed May 12, 2010 12:57 pm

I want to use the jQuery sIFR plugin to display the product name on Product3.aspx, which uses the document ready function to replace the content of a particular div with a swf displaying the text.
I have tried putting this function in several places, including the head section of Scriptlet.master and in App_Data\Scriptlets\Custom\Content\Show Product 1.htm, but it doesn't seem to be executing.
I'm sure that the solution is something very simple, but I'm just not finding it.

michael.p.larsen
Lieutenant (LT)
Lieutenant (LT)
Posts: 70
Joined: Fri Jan 15, 2010 8:17 am

Re: JQuery ready function location

Post by michael.p.larsen » Wed May 12, 2010 1:00 pm

I added all my onload stuff to the Header area of the Standard Header scriptlet. Works great.

jenn.bohm
Ensign (ENS)
Ensign (ENS)
Posts: 2
Joined: Tue May 11, 2010 4:09 pm

Re: JQuery ready function location

Post by jenn.bohm » Wed May 12, 2010 1:16 pm

Hmm, it didn't work for me. We have a custom header scriptlet, and I put this at the very top of our header scriptlet:

<script type="text/javascript">
$(document).ready(function()
{
$('#ProductTitle').sifr({ build: 436, version: 3, path: 'Resources/', font: 'Futura-Condensed-Bold', color: '#000000', save: true });
});
</script>

But, it's not executing for me.
I can put a plain alert inside the script tags in the same spot, and it executes, but as soon as I put in a document ready function, it doesn't happen.

dappy2
Commander (CMDR)
Commander (CMDR)
Posts: 114
Joined: Wed Jan 18, 2006 5:53 pm
Contact:

Re: JQuery ready function location

Post by dappy2 » Wed May 12, 2010 1:31 pm

I have all mine load in the ScriptManager on the master pages and moved all jquery functions to an external Javascript file:

Code: Select all

    <ajax:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
        <Scripts>
            <ajax:ScriptReference Path="~/js/WebKitFix.js" />
            <ajax:ScriptReference Path="~/js/common.js" />
            <ajax:ScriptReference Path="~/js/jquery-1.3.2.min.js" />
            <ajax:ScriptReference Path="~/js/custom.js" />
        </Scripts>
    </ajax:ScriptManager>


michael.p.larsen
Lieutenant (LT)
Lieutenant (LT)
Posts: 70
Joined: Fri Jan 15, 2010 8:17 am

Re: JQuery ready function location

Post by michael.p.larsen » Wed May 12, 2010 1:33 pm

Add the script src for the sIFR files and jQuery to the header, BEFORE the ready function. This is what I have:

Code: Select all

<script type="text/javascript" src="js/fancybox/jquery.mousewheel-3.0.2.pack.js"></script>
<script type="text/javascript" src="js/fancybox/jquery.fancybox-1.3.1.js"></script>
<link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox-1.3.1.css" />
<script src="js/jquery.lazyload.mini.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
$("img").lazyload({
placeholder : "images/grey.gif",
failurelimit : 5000
});
});
</script>

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: JQuery ready function location

Post by jmestep » Tue May 18, 2010 7:59 am

Jenn- if there is nVelocity code on the scriplet using the $, you might have to use jQuery instead of $. We ran into that in one place.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Post Reply