Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8199617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:12:28+00:00 2026-06-07T06:12:28+00:00

I am trying to implement a slider in a coldfusion page & written jQuery

  • 0

I am trying to implement a slider in a coldfusion page & written jQuery script for fetching images through XML file. My XML file is including paths & other details of the Image. But it’s not working, though it did for simple file on my WAMP server.
ColdFusion Code:

<cfoutput>
<script type="text/javascript" src="#request.serverCustom#rangers/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="#request.serverCustom#rangers/js/simplegallery.js"></script>
<script type="text/javascript">
    var myArray = [];    
    $(document).ready(function() {
        alert("outside");
        $.ajax({
            //alert("ajax inside");
            type: "GET",
            url: "#request.serverCustom#rangers/js/sites.xml",
            dataType: "xml",
            success: function(xml) {
                var count = 0;
                $(xml).find('site').each(function() {
                    var url = $(this).find('url').text();
                    var target = $(this).find('target').text();
                    var imageURL = $(this).find('imageURL').text(); 
                    var alt = $(this).find('alt').text();
                    myArray[parseInt(count)] = new Array(imageURL, url, target, alt); 

                    count++;
                });
                var mygallery2 = new simpleGallery({
                    wrapperid: "simplegallery2",
                    dimensions: [400, 240],                 
                    imagearray: myArray,                    
            autoplay: [true, 10000, 99], 
                    persist: true,
                    fadeduration: 1000, 
                    oninit: function() {
                    },
                    onslide: function(curslide, i) { 
                    }
                })                
            }
        });
alert(mygallery2);
    });
</script>
<div style="background: black none repeat scroll 0% 0%; overflow: hidden; 
position: relative; visibility: visible; -moz-background-clip: border; -moz-background-origin: 
padding; -moz-background-inline-policy: continuous; width: 400px; height: 265px;" id="simplegallery2"> 
</div>
</cfoutput>

My XML Code:-

<?xml version="1.0" encoding="iso-8859-1"?>
<sites>
  <site>
    <url><![CDATA[http://facebook.com]]></url>
    <target>_new</target>
    <alt>First Image : Random Image with Baloon(Will Go to FB)</alt>
    <imageURL><![CDATA[/img/Image1.jpg]]></imageURL>
  </site>

  <site>
    <url><![CDATA[http://google.com]]></url>
    <target>_new</target>
    <alt>Second Image : Random Image of a Toy(Will Go to Google)</alt>
    <imageURL><![CDATA[/img/Image2.jpg]]></imageURL>
  </site>

  <site>
    <url><![CDATA[http://twitter.com]]></url>
    <target>_new</target>
    <alt>Third Image : Random Image with Lighter with Water Filled</alt>
    <imageURL><![CDATA[/img/Image3.jpg]]></imageURL>
  </site>

  <site>
    <url><![CDATA[http://enablingdimensions.com]]></url>
    <target>_new</target>
    <alt>Fourth Image : A Image from Game(Will Go To Our Site)</alt>
    <imageURL><![CDATA[/img/Image4.jpg]]></imageURL>
  </site>

  <site>
    <url><![CDATA[http://ed.konnected.me]]></url>
    <target>_new</target>
    <alt>Fifth Image : A Cartoon in Yellow Background</alt>
    <imageURL><![CDATA[/img/Image5.jpg]]></imageURL>
  </site>

  <site>
    <url><![CDATA[http://yahoo.com]]></url>
    <target>_new</target>
    <alt>Sixth Image : Eating Fish with Anger(Will Go To Yahoo)</alt>
    <imageURL><![CDATA[/img/Image6.jpg]]></imageURL>
  </site>

</sites>

My folder “img” is located in the local path. Even I tried alert inside $.ajax, but it got break. I tried with fetching link image too, which worked with WAMP, but that also didn’t work.
Any clue ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:12:29+00:00Added an answer on June 7, 2026 at 6:12 am

    There is no ColdFusion code in your sample (apart from #request.serverCustom#). IN which case you don’t need to bracket the whole dang script. Put outputs around just those variables as such.

    <cfoutput>
    <script type="text/javascript" src="#request.serverCustom#rangers/js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="#request.serverCustom#rangers/js/simplegallery.js"></script>
    </cfoutput>
    

    And then inside the JS:

     type: "GET",
     url: "<Cfoutput>#request.serverCustom#</cfoutput>rangers/js/sites.xml",
    

    Bracketing the whole thing will work, but it seems messier to me (although others will prefer it).

    If you ARE having an issue with CF it is likely this var that is the issue. Load your page and go to “view source” – check out the HTML that is rendered. If the path to your jquery-1.3.2.min.js and simplgallery.jas files are screwed up then you need to fix it by adjusting the #request.serverCustom# variable – or by adding a slash or whatever.

    I usually copy out from view source and load the path in my browser to see what I get (adjusting for relative vs absolute of course.

    If it’s something else I’m afraid we will need a bit more information. What is it actually doing?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement Orbit Slider in my homepage using this code: <script type=text/javascript
I'm trying to implement a jQuery slider with increments. I've gone from, the actual
I am currently trying to implement a jquery slider into a joomla website. I
I am trying to implement a type of slider using jquery. However this question
I'm trying to implement a page where there are 4 jQuery-UI sliders, and I
I am trying to implement a one page slider to a homepage and I
I am trying to implement a moving photo slider that is no jQuery ,
Hey there guys! I am trying to implement Easy Slider jQuery Plugin Version 1.7
I'm trying to implement a tab slider using the .scrollTo plug-in for jQuery. Here's
I'm trying to implement a jQuery slider control for opacity of a certain element

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.