Solved

How can I call my own function inside the AJAX/jQuery $.get() method?

Posted on 2009-05-14
2
452 Views
Last Modified: 2012-05-07
I want to do something like this:
$("#go_button").click(function(){

				 $.get("../RECORDS/GetEmployeeInfo", function(data) {

					 populateEmployeeTable(data); <-----it doesn't recognize this function that I created in a separated .js file

				 });				 

			});

Open in new window

0
Comment
Question by:Corinne_09
2 Comments
 
LVL 12

Accepted Solution

by:
alien109 earned 500 total points
ID: 24390308
As long as the external js file is included before that code executes, and it is defined in the global scope, it should be fine.

Maybe something else?
Wrong path?
Error in some of the other javascript?

Can you provide some source or a link?
0
 

Author Closing Comment

by:Corinne_09
ID: 31581708
All my file paths  and references are ok. But I found the error. It was an extra bracket at the end of the js file. Everythings ok now. Thanks.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now