Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirecting based on suggestion list #458

Open
saravanamani1999 opened this issue Jul 20, 2021 · 0 comments
Open

Redirecting based on suggestion list #458

saravanamani1999 opened this issue Jul 20, 2021 · 0 comments

Comments

@saravanamani1999
Copy link

var options = {
	url: "https://saravanamani1999.github.io/api/moduleInfo.json",

	getValue: "moduleCode",

	adjustWidth: false,

	template: {
		type: "description",
		fields: {
			description: "title"
		}

	},

	list: {
		maxNumberOfElements: 10,
		match: {
			enabled: true
		},
		showAnimation: {
			type: "slide", //normal|slide|fade
			time: 300,
			callback: function() {}
		},

		hideAnimation: {
			type: "slide", //normal|slide|fade
			time: 300,
			callback: function() {}
		},
		onClickEvent: function(event, ui) {
			// alert("click");
			location.href = "http://localhost:3000/modules/" + moduleCode
		}
	},
	theme: "round"
};

`$("#search-bar").easyAutocomplete(options);

Hi, im currently trying to redirect my webpage based on the suggestion list based on my json api. So onClickEvent, i want it to redirect to the "http://localhost:3000/modules/" followed by the item clicked which is moduleCode. Any help would be much appreciated. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant