Documentation You are here: start » v » 1.1 » javascript

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v:1.1:javascript [2013/07/10 20:46] – Adding jQuery dependency info 76.114.125.57v:1.1:javascript [2017/04/26 07:02] (current) – external edit 127.0.0.1
Line 51: Line 51:
   - <wrap tip>The ''www'' subdomain is effectively ignored</wrap>, so if you //do// want to lock your sessions down to ''.www.example.com'' you'll need to set the ''sitedomain'' value to something like ''www1.example.com''. The actual value doesn't matter; it's only counting the dots in the value after it strips the ''www''.   - <wrap tip>The ''www'' subdomain is effectively ignored</wrap>, so if you //do// want to lock your sessions down to ''.www.example.com'' you'll need to set the ''sitedomain'' value to something like ''www1.example.com''. The actual value doesn't matter; it's only counting the dots in the value after it strips the ''www''.
   - <wrap important>You //cannot// have the FoxyCart javascript at any other subdomains</wrap> if you are isolating by subdomain. For example, if you have two separate stores at ''products.example.com'' and ''donations.example.com'' you //cannot// also have your ''foxycart.js'' at ''www.example.com'' or ''example.com'', as that will set the session cookie at ''.example.com'', which will override the ''products'' and ''donations'' session cookies.   - <wrap important>You //cannot// have the FoxyCart javascript at any other subdomains</wrap> if you are isolating by subdomain. For example, if you have two separate stores at ''products.example.com'' and ''donations.example.com'' you //cannot// also have your ''foxycart.js'' at ''www.example.com'' or ''example.com'', as that will set the session cookie at ''.example.com'', which will override the ''products'' and ''donations'' session cookies.
 +
 +**Example:** If you're testing two different sites at subdomains of the same domain (like ''store1.example.com'' and ''store2.example.com''), you'd put this script tag before the FoxyCart script tag:
 +<code html>
 +<script type="text/javascript" charset="utf-8">
 + var sitedomain = 'store1.example.com';
 +</script>
 +</code>
 +<wrap tip>**Note:** You probably wouldn't want to keep this in production, unless the site //only// lives at a subdomain, and is never available at the ''example.com'' top level domain.</wrap>
 +
 +
 ==== ''cookiepath'': The Path on Which Your Visitor's FoxyCart Cookies Are Set ==== ==== ''cookiepath'': The Path on Which Your Visitor's FoxyCart Cookies Are Set ====
 The ''cookiepath'' determines the ''fcsid'' cookie's path. This is almost always going to be empty, so the cookies would be set at ''.example.com'', but if you do need to have multiple FoxyCart sessions on the same domain you could use this setting to restrict cookies to something like ''.example.com/en/'' and ''.example.com/es/'' (to split English and Spanish FoxyCart stores, for example). The ''cookiepath'' determines the ''fcsid'' cookie's path. This is almost always going to be empty, so the cookies would be set at ''.example.com'', but if you do need to have multiple FoxyCart sessions on the same domain you could use this setting to restrict cookies to something like ''.example.com/en/'' and ''.example.com/es/'' (to split English and Spanish FoxyCart stores, for example).
Line 56: Line 66:
 <wrap important>The ''cookiepath'' value must end in a ''/''</wrap> or you may run into issues, especially with Internet Explorer. The leading slash is automatically applied by the ''foxycart.js'', so if you want a path of ''/en/'' you would enter ''cookiepath = 'en/';''. <wrap important>The ''cookiepath'' value must end in a ''/''</wrap> or you may run into issues, especially with Internet Explorer. The leading slash is automatically applied by the ''foxycart.js'', so if you want a path of ''/en/'' you would enter ''cookiepath = 'en/';''.
  
-*Example:* Suppose you have a donations section and a bookstore, located at ''http://example.com/donations/'' and ''http://example.com/bookstore/''. (<wrap important>Note that the trailing slash is critical.</wrap> If you have something like ''http://example.com/bookstore'' and ''http://example.com/donations'' this method will not work and the sessions will collide.) Add the following code before your calls to ''foxycart.complete.js'' or ''foxycart.js''. Obviously, change out the "donations" with "bookstore" depending on where you're placing this code.+**Example:** Suppose you have a donations section and a bookstore, located at ''http://example.com/donations/'' and ''http://example.com/bookstore/''. (<wrap important>Note that the trailing slash is critical.</wrap> If you have something like ''http://example.com/bookstore'' and ''http://example.com/donations'' this method will not work and the sessions will collide.) Add the following code before your calls to ''foxycart.complete.js'' or ''foxycart.js''. Obviously, change out the "donations" with "bookstore" depending on where you're placing this code.
  
 <code html><script type="text/javascript" charset="utf-8"> <code html><script type="text/javascript" charset="utf-8">
Line 122: Line 132:
   * ''add'': Adds the function to the event's function array.   * ''add'': Adds the function to the event's function array.
   * ''add_pre'': Adds the function to the event's function array //before// any other functions in the array.   * ''add_pre'': Adds the function to the event's function array //before// any other functions in the array.
-  * ''resume'': Resumes a previously "paused" event. If ''pause'' is returned, execution of the event function array stops, but it keeps its place. This is very useful if you need to ensure that request +  * ''resume'': Resumes a previously "paused" event. If ''pause'' is returned, execution of the event function array stops, but it keeps its place. This is very useful if you need to ensure that an asynchronous request has completed before proceeding.
   * ''execute'': Execute's all the functions in the array, stopping if ''false'' is returned. (This is mostly an internal method, and won't likely be used by even very advanced integrations.)   * ''execute'': Execute's all the functions in the array, stopping if ''false'' is returned. (This is mostly an internal method, and won't likely be used by even very advanced integrations.)
  

Site Tools