Forum Moderators: open
It works great, but it doesn't work cross-domain, the way it is designed is as follows, in a input tag, you write "url-search-uni.php", then the javascript code, removes the "url-" and just call the remaining "search-uni.php",
<input type="text" class="ajax-suggestion url-search-uni.php"> I asked the developer how to tweak the javascript to have it able to process a input like:
<input type="text" class="ajax-suggestion url-http://mysite.com/js/search-uni.php"> He told me that it should work if a line in the file: ajaxSuggestions.js
told me that tweaking this line it can allow the form to accept and process a url input instead of only the filename,
var url = this.currentElm.className.replace(/.*url-([\w\/\?\.-]+).*/, "$1");
Thanks in advance!
[edited by: coopster at 7:11 pm (utc) on Dec. 8, 2008]
[edit reason] removed link [/edit]
.*followed by
url-and then the matching subpattern. Matching subpatterns have parentheses surrounding them. I would like to believe that you could merely change that pattern to find anything after that which does not match either a space character or another double quotation mark.
var url = this.currentElm.className.replace(/.*url-([^\s"]+).*/, "$1");