Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
Javascript And PHP Ajax
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Markshall" data-source="post: 412350" data-attributes="member: 1872"><p>You're defining a function called <span style="font-family: 'Courier New'">toggleProfile</span> but not actually invoking it. And even then, where is the <span style="font-family: 'Courier New'">id</span> parameter coming from?</p><p></p><p>Also, in your JavaScript, all you appear to be sending is an ID number, no parameter names.</p><p></p><p>It should be something like this (also change your method to GET rather than POST. You're not posting anything, you're trying to get information. This will also need updating in your PHP):</p><p>This code refers to a variable called <span style="font-family: 'Courier New'">id</span>, but you'll need to figure out how to grab it from your link.</p><p>[CODE]<script></p><p> $("#admin").click(function() {</p><p> $.ajax({</p><p> url: "getProfile.php",</p><p> method: "GET",</p><p> data: 'id=' + id,</p><p> success: function(data) {</p><p> $("#profile").html(data);</p><p> },</p><p> error: function() {</p><p> console.log('Error occurred');</p><p> }</p><p> });</p><p> });</p><p></script>[/CODE]</p><p></p><p>After that, you're filling the <span style="font-family: 'Courier New'">#profile</span> element, but where is it opening? There's no code in there which looks like it is opening the modal dialog.</p></blockquote><p></p>
[QUOTE="Markshall, post: 412350, member: 1872"] You're defining a function called [FONT=Courier New]toggleProfile[/FONT] but not actually invoking it. And even then, where is the [FONT=Courier New]id[/FONT] parameter coming from? Also, in your JavaScript, all you appear to be sending is an ID number, no parameter names. It should be something like this (also change your method to GET rather than POST. You're not posting anything, you're trying to get information. This will also need updating in your PHP): This code refers to a variable called [FONT=Courier New]id[/FONT], but you'll need to figure out how to grab it from your link. [CODE]<script> $("#admin").click(function() { $.ajax({ url: "getProfile.php", method: "GET", data: 'id=' + id, success: function(data) { $("#profile").html(data); }, error: function() { console.log('Error occurred'); } }); }); </script>[/CODE] After that, you're filling the [FONT=Courier New]#profile[/FONT] element, but where is it opening? There's no code in there which looks like it is opening the modal dialog. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Javascript And PHP Ajax
Top