javascript question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amateurbfs
    Confirmed User
    • Jun 2010
    • 1316

    #1

    javascript question

    This is probably vague, I don't really know what I am doing.

    Doing this inside of a frame, I want to open in _top not the same frame the code is in.

    Code:
    <select name="page_id" id="page_id"  onchange="javascript:dropdown_post_js(this)">
    Code:
    <script type="text/javascript">
    
    function dropdown_post_js(menuObj) {
    
    	var i = menuObj.selectedIndex;
    
    	
    
    	if(i > 0)
    
    	{
    
    	if(menuObj.options[i].value != '#')
    
    		{
    
    			window.location = menuObj.options[i].value;
    
    		}
    
    	}
    
    }
    
    </script>
    Last edited by amateurbfs; 07-30-2011, 09:59 AM.
  • MediaGuy
    Confirmed User
    • Sep 2004
    • 5500

    #2
    Just make the link in the page the frame shows open ''_top"....

    :D

    YOU Are Industry News!
    Press Releases: pr[at]payoutmag.com
    Facebook: Payout Magazine! Facebook: MIKEB!
    ICQ: 248843947
    Skype: Mediaguy1

    Comment

    • amateurbfs
      Confirmed User
      • Jun 2010
      • 1316

      #3
      cant do that, since the links are in a select form I believe I need the javascript

      Code:
      <script type="text/javascript">
      
      function dropdown_post_js(menuObj) {
              if(menuObj.options[menuObj.selectedIndex].value.length > 0)
              window.open(menuObj.options[menuObj.selectedIndex].value);
      }
      
      </script>
      this will open them in _blank, really I just wanna send these guys back to my site w/ no frames, same window.

      Comment

      • sarettah
        see you later, I'm gone
        • Oct 2002
        • 14297

        #4
        use parent.location to make the parent page go to the url you want.

        parent.location = menuObj.options[menuObj.selectedIndex].value;
        All cookies cleared!

        Comment

        Working...