Also Can't Get Examples to Work

1 view
Skip to first unread message

TerriKat

unread,
Jun 30, 2008, 1:16:09 PM6/30/08
to mxAjax
Hello, I'm rather new to all this so I may be missing something
incredibly obvious, but I also can't seem to get the examples to work
properly, and I'm not getting any error messages. I've tried looking
through the other threads and can't seem to find anything that will
help.

Nothing dealing with the database is getting the info:
http://digitalarts.bgsu.edu/mxAjax/examples/index.cfm

I'm running CF 6.1, and I stuck the mxAjax folder in the root
directory. I know I have the database connected properly because of
the test page I wrote up and stuck into the same folder:
http://digitalarts.bgsu.edu/mxAjax/examples/checkdb.cfm

In case I may be doing something different, here's the code I used for
the checkdb.cfm:

<cfquery name="checking" datasource="mxAjaxData">
SELECT * FROM PhoneMake
</cfquery>

<cfoutput query="checking">
#id#, #make#, #name#
#description# <br />
</cfoutput>

<cfquery name="checking2" datasource="mxAjaxData">
SELECT * FROM PhoneModel
</cfquery>

<cfoutput query="checking2">
<p>#id#, #make#, #name#, #description# #image# </p>
</cfoutput>

Can anyone make heads or tails of what might be the problem?

James Holmes

unread,
Jun 30, 2008, 11:12:06 PM6/30/08
to mxa...@googlegroups.com
Your code still has:

var url = "http://localhost/mxajax/core/cf/example.cfc";


localhost is my machine, not yours. This needs to change to the same
domain as your site.

--
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

TerriKat

unread,
Jul 1, 2008, 10:52:50 AM7/1/08
to mxAjax
Okay. I made the change from "localhost" to "digitalarts.bgsu.edu" in
application.cfm and it wouldn't work. Then I saw you said "var url",
so I also went through the js files and cfc files to change anything
that said localhost to digitalarts.bgsu.edu (which only showed up in
example.cfm and mxAjax.cfm). There is still no change.

On the side, thank you for having the patience to work with someone
new at all this.

James Holmes

unread,
Jul 1, 2008, 11:59:17 PM7/1/08
to mxa...@googlegroups.com
For everyone's benefit, here's the steps I'm taking to debug.

1) Turn on FireBug for the site (it's a FireFox add-on that's
absolutely essential for AJAX debugging)
2) load the page
3) note that the ajax request is being made correctly now and that it
goes to something like:

http://digitalarts.bgsu.edu/mxajax/core/cf/example.cfc?&ajaxcallid=9210_1214970779074&method=init&function=makelookup&make=Nokia&_=

4) visit the URL above directly in a browser
5) see the error:

Parameter validation error for function RANDRANGE.
The function takes 2 parameters.

The error occurred in C:\Program Files\Apache
Group\Apache\htdocs\mxAjax\core\cf\example.cfc: line 46

44 : <cffunction name="getRandomQuote">
45 : <cfquery datasource="#request.mxAjaxDS#" name="qryData">
46 : SELECT * FROM quote WHERE id = #RandRange(1, 21, "SHA1PRNG")#
47 : </cfquery>
48 : <cfsavecontent variable="out">

This means you're running cf6.1 or lower (which you said in your
original email). The example was written for CF7, which has a
different randRange() function. Edit the example to get rid of the
third argument on line 46 and you should be fine.

TerriKat

unread,
Jul 2, 2008, 9:27:29 AM7/2/08
to mxAjax
Yes, it's working now. Thank you so much!

On Jul 1, 11:59 pm, "James Holmes" <james.hol...@gmail.com> wrote:
> For everyone's benefit, here's the steps I'm taking to debug.
>
> 1) Turn on FireBug for the site (it's a FireFox add-on that's
> absolutely essential for AJAX debugging)
> 2) load the page
> 3) note that the ajax request is being made correctly now and that it
> goes to something like:
>
> http://digitalarts.bgsu.edu/mxajax/core/cf/example.cfc?&ajaxcallid=92...
Reply all
Reply to author
Forward
0 new messages