Jump to content

doug007

Members
  • Posts

    62
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

doug007's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks Jay. parse_str is a nice little function
  2. ok this isn't working it errors out: Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 1 $pattern='/^?[^=]+=(.*)$/'; if(preg_match($pattern, "home", $matches)){ //$this->page=$this->urlpage; var_dump($matches); }
  3. hi guys, give this string ?page=home how would you match/get anything after the = sign? thanks
  4. great this actually works. but its taking a little to close, can this be improved?
  5. Hi Guys, I'm trying to close a window without getting the prompt. i am using this code: function NoConfirm(){ window.opener = top; window.close (); } window.onLoad = NoConfirm; </script> </head> <body onLoad="popup(); NoConfirm(); window.close();"> [/code/
  6. sorry adam my bad. i found a way around this problem, but this leads me to another question? is it possible to actualy edit the a popup window so it does not show the top part of the window and the borders, so say i have form on the popup i only want that to be visiable and nothoing else?
  7. thats cool, but I want to remain on the same window and the page does not have reload, hence why we using #
  8. here is live demo: http://www.pat-burt.com/csspopup.html#
  9. this is how i am calling it: <a href="#" onclick="popup('popUpDiv')">popup</a>
  10. thanks, the problem appears to be that the url is not sent over to the popup. so how would i go about sending the url to the popup, how can i modify the js. sadly i am not js guru....any help would really appriciated. thanks
  11. okay here i tested and it worked <script language="javascript" type="text/javascript"> var strurl=window.location.href+""; var splitted=strurl.split("#"); alert(splitted[1]); </script> but it does not work on the popup window. initially the url is this: http://wtgforum-internal/index.php?action=calendar# when you click on a link to create the popup <a href="<?=$url?>" onclick="popup('popUpDiv')"><?=$title?></a> it creates a popup, then the url on the parent window chnages to this http://wtgforum-internal/index.php?action=calendar#222222 and your script only prints out 'undefined' on the popup window. the js the creates the popup is here function toggle(div_id) { var el = document.getElementById(div_id); if ( el.style.display == 'none' ) { el.style.display = 'block';} else {el.style.display = 'none';} } function blanket_size(popUpDivVar) { if (typeof window.innerWidth != 'undefined') { viewportheight = window.innerHeight; } else { viewportheight = document.documentElement.clientHeight; } if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) { blanket_height = viewportheight; } else { if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) { blanket_height = document.body.parentNode.clientHeight; } else { blanket_height = document.body.parentNode.scrollHeight; } } var blanket = document.getElementById('blanket'); blanket.style.height = blanket_height + 'px'; var popUpDiv = document.getElementById(popUpDivVar); popUpDiv_height=blanket_height/2-350;//150 is half popup's height popUpDiv.style.top = popUpDiv_height + 'px'; } function window_pos(popUpDivVar) { if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerHeight; } else { viewportwidth = document.documentElement.clientHeight; } if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) { window_width = viewportwidth; } else { if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) { window_width = document.body.parentNode.clientWidth; } else { window_width = document.body.parentNode.scrollWidth; } } var popUpDiv = document.getElementById(popUpDivVar); window_width=window_width/2-150;//150 is half popup's width popUpDiv.style.left = window_width + 'px'; } function popup(windowname) { blanket_size(windowname); window_pos(windowname); toggle('blanket'); toggle(windowname); }
  12. this is taken soo much hair of my head....but yeah lets see if someone here has come across something similar... cheers guys
  13. split a url by "#" and get the array of index 1 how do i do this?
  14. the popup pops up and i the url of the parent window changes from: http://wtgforum-internal/index.php?action=calendar# to http://wtgforum-internal/index.php?action=calendar#222222 so i wan to grab the latter
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.