Quantcast
Channel: Adobe Community : Popular Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 14291

Invoke a ColdFusion function via URL

$
0
0

Hi I'm trying to invoke a ColdFusion function via typing in a URL in the web address bar such as:

 

http://domain.com/path/to/your.cfc?method=functionName&argument1=arg1Val

 

I have to do it this way for testing purposes. How can I invoke the following below function "showWinDOTD();" from the script below via URL? I have tried continuously the following with no luck:

 

http://site.com/act/actCart.cfm?method=showWinDOTD

http://site.com/act/actCart.cfm?method=showWinDOTD

 

Am I missing something simple?

 

 

 

<script>

  var refreshInterval = 0;

  var winFlag = false;

  $(function() {

  if(refreshInterval>0)

  {

  setTimeout('location.reload();',refreshInterval);

  }

  });

    function submitForm() {

        ColdFusion.Ajax.submitForm('DOTDform','/act/actCart.cfm',callback,errorHandler);

    }

    function selectDOTD(input,promoID,optionID)

  {

  input.disabled = true;

  formObj = input.form;

  formObj.PromoID.value = promoID;

  formObj.OptionID.value = optionID;

        ColdFusion.Ajax.submitForm(formObj.name,'/act/actCart.cfm',callback,errorHandler);

    }

  function callback(text)

  {

  text = (text.replace(/^\s+|\s+$/g,"")).toUpperCase();

  if(text=='ADDED')

  window.location = 'https://www.site.com/checkout/cart.cfm?uiID=16';

  else if(text=='MAXED')

  window.location = 'https://www.site.com/checkout/cart.cfm?uiID=43';

  else if(text=='SOLD')

  {

  if(!winFlag)

  {

  winFlag = true;

  showWinDOTD();

  }

  else

  {

  ColdFusion.Window.onHide('results',showWinDOTD);

  ColdFusion.Window.hide('results');

  }

  }

  else {

  window.location = '/';

  }

  }

  function errorHandler(code, msg)

    {

       showWinDOTD();

    }

  function reloadPage()

  {

  window.location.reload();

  }

  function showWinDOTD()

  {

  ColdFusion.Window.show('results');

  ColdFusion.Window.onHide('results',reloadPage);

  }

</script>


Viewing all articles
Browse latest Browse all 14291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>