PDA

View Full Version : Malfunction on subdomain



Mister Micawber
08-09-2010, 12:03 PM
1) Script Title: jQuery Image Magnify v1.1

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/imagemagnify.htm

3) Describe problem: I have this running nicely on my domain, but it does not run on my subdomain. The jquery.magnifier.js and magnify.cur files are in public_html (if that helps). I have checked the head code on both pages carefully. The one thing I have noticed is that my host (Justhost) adds a bit of code (in bold below) which I cannot delete-- and I don't know what it means, either-- so the whole thing looks like this:


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="jquery.magnifier.js" type="text/javascript">// <![CDATA[
/***********************************************
* jQuery Image Magnify- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
// ]]></script>


Is that the problem? Or? I've run out of ideas.

Many thanks for your time and trouble.

MM

jscheuer1
08-09-2010, 02:55 PM
That shouldn't matter (the CDATA delimiters). If the script and the cursor are in the public_html folder, only a page that is also in that folder may use them given your script tag.

Ordinarily, you would use a relative path to the folder, but with a subdomain, you may need the network or even the absolute path. The absolute path is safest. Say your public_html folder is (in the browser):


http://www.mydomain.com/

Then your script tag should be:


<script src="http://www.mydomain.com/jquery.magnifier.js" type="text/javascript">// <![CDATA[
/***********************************************
* jQuery Image Magnify- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
// ]]></script>

And here, in the jquery.magnifier.js file:


/* jQuery Image Magnify script v1.1
* This notice must stay intact for usage
* Author: Dynamic Drive at http://www.dynamicdrive.com/
* Visit http://www.dynamicdrive.com/ for full source code

* Nov 16th, 09 (v1.1): Adds ability to dynamically apply/reapply magnify effect to an image, plus magnify to a specific width in pixels.
*/

jQuery.noConflict()

jQuery.imageMagnify={
dsettings: {
magnifyby: 3, //default increase factor of enlarged image
duration: 500, //default duration of animation, in millisec
imgopacity: 0.2 //opacify of original image when enlarged image overlays it
},
cursorcss: 'url(http://www.mydomain.com/magnify.cur), -moz-zoom-in', //Value for CSS's 'cursor' attribute, added to original image
zIndexcounter: 100,

refreshoffsets:function($window, . . .

Mister Micawber
08-11-2010, 05:22 AM
Bless you, John. It worked like a dream! I envy you fellows that understand all this. I'm too old to ever hope to get it all into my brain.

- MM