asprin
Active member
I've the ajax call set up as following:
	
	
	
		
But line 3 generating an invalid URL, something like the following:
i.e. spitting it out as is. How can make
For the record, I'm registering the event as per XF system...ie
	
	
	
		
				
			
		JavaScript:
	
	var config = {
    method: 'post',
    action: "{{link('vendor/my-function')}}", // the route is set via ACP
    successCallback: XF.proxy(this, 'processResponse'),
    ajaxOptions: { skipDefault: true }
};
XF.ajax(
    config.method,
    config.action,
    {'f':selection},
    config.successCallback,
    config.ajaxOptions
);
	But line 3 generating an invalid URL, something like the following:
i.e. spitting it out as is. How can make
link() work inside a .js file?For the record, I'm registering the event as per XF system...ie
		JavaScript:
	
	!(function($, window, document, _undefined) {
  'use strict';
  asprin.OnFormatSelection = XF.Event.newHandler({
    eventType: 'change',
    eventNameSpace: 'AsprinOnFormatSelection',
    init: function() {
      console.debug('handler initialized');
    },
    change: function(event) {
      // this is where my XF.ajax() goes
    },   
  });
  XF.Event.register('change', 'blah-blah', 'asprin.OnFormatSelection');
})(jQuery, window, document);