vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   javascript popup with php (https://vborg.vbsupport.ru/showthread.php?t=42460)

mr e 08-18-2002 09:18 PM

javascript popup with php
 
ok basically the popup just doesn't come up, i copied most of the javascript from beta.vbulletin.com/vb3 (sad huh) and changed the variables and stuff to work for my site, but all i get when i click the link is a javascript error, the ! in a yellow triangle in the bottom left corner of IE, so here is my code...
PHP Code:

echo '<script type="text/javascript">'
             
.'<!--'
             
.'function ip(id) {'
             
.'window.open("index.php?action=ippopup&id="+id,"toolbar=no,location=no,menubar=no,scrollbars=no,width=100,height=50,resizeable=no,status=no");'
             
.'}'
             
.'// -->'
             
.'</script>'

and here is what i call it with
PHP Code:

<a href=\"javascript:ip($id)\">[IP]</a> 

so any ideas on why it wont work? thanks :D

edit: there IS a \ in front of the "javascript:ip($id) but for some reason it isn't there in the post

Ajay 08-18-2002 11:39 PM

why do you have it in PHP? why not just have it in normal html and echo the variables

<script type="text/javascript">
<!-- <? function ip(id) { ?>
window.open("index.php action=ippopup&id="+id,"toolbar=no,location=no,men ubar=no,scrollbars=no,width=10 0,height=50,resizeable=no,status=no")
<? } ?>
// -->
</script>

<a href="java script:<? echo "ip(id)";?>><?echo "[$IP]";?></a>

mr e 08-18-2002 11:46 PM

because it's inside of php script, and i just need help on the java part

Ajay 08-18-2002 11:56 PM

<? if ($blah) { ?>
<script type="text/javascript">
<!-- <? function ip(id) { ?>
window.open("index.php action=ippopup&id="+id,"toolbar=no,location=no,men ubar=no,scrollbars=no,width=10 0,height=50,resizeable=no,status=no")
<? } ?>
// -->
</script>

<a href="java script:<? echo "ip(id)";?>><?echo "[$IP]";?></a>
<? }
continue the script ?>

mr e 08-19-2002 12:41 AM

the function ip(id) isn't php, it's javascript, but maybe that way could work...hrmmm...

*goes off to try again*


All times are GMT. The time now is 10:35 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01544 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete