Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Create a div with an iframe in it, based on reply of ajax get from a php file.
Old 11-22-2009, 11:52 AM Create a div with an iframe in it, based on reply of ajax get from a php file.
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
Hi Guys..

How can i achieve this?

I have a php file called showornot.php

It will return either 1 or 0

With javascript ajax how can i have the browser check showornot.php
and if it returns 1, The js will need to create a div above the page with an iframe in it.

Any ideas how to do it?


I have code to do normal ajax , However this will just fill a div with the returned data from the php file..
I need JS to look at the result and then show a div if the data returned is "1"

Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
         <script language="javascript" type="text/javascript">
<!--
          function getdata() {
          $(\'#mydiv \').load(\'showornot.php\');
          }
          //-->
</script>
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
 
Register now for full access!
Old 11-24-2009, 05:55 AM Re: Create a div with an iframe in it, based on reply of ajax get from a php file.
Super Talker

Posts: 139
Name: John Davis
Trades: 0
I see you don't understand difference between AJAX and jQuery.
The easiest way for you is to get neseccary data from showornot.php (not just 1 or 0 but HTML which you have to set to DIV)
__________________
»
Please login or register to view this content. Registration is FREE
- Interactive maps for websites
»
Please login or register to view this content. Registration is FREE
for web developers
MapMaster is offline
Reply With Quote
View Public Profile Visit MapMaster's homepage!
 
Reply     « Reply to Create a div with an iframe in it, based on reply of ajax get from a php file.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.42097 seconds with 12 queries