Results 1 to 3 of 3

Thread: Javascript frames mess up php / query

Hybrid View

  1. #1
    Join Date
    Oct 2009

    Javascript frames mess up php / query

    Hi there,

    I'm using javascript (frames.js) in PHP to load frames into my website.
    When I use a query to retrieve information with $_GET out of the db (e.g. mydomain.com/article.php?cat=news), the result of $_GET puts a '?' question mark behind the result (e.g. news?)

    I know this is because of the frames.js. But I don't know how I can solve it.
    Below you'll find the script and it comes with '<frame src="'+ window.location +'?". Notice the question mark behind window.location. This makes the result of the query comes with a '?'.

    The problem is that when I remove the question mark the frames will not load. My knowledge about JS is really minimum, so I'm wondering if anybody here can tell me what to do and what will be the right code.

    Thanks in advance.

    if(parent.frames.length == 0){
    document.write('<frameset cols="*,900,*" border="0" frameborder="0">'
    + '<frame src="left.php" name="left" target="_self" scrolling="no" />'
    + '<frameset rows="136,*" />'
    + '<frame src="top.php" name="top" scrolling="no" noresize target="_self" />'
    + '<frameset cols="160,740" />'
    + '<frame src="links.php" name="links" target="middle" scrolling="no" noresize />'
    + '<frame src="'+ window.location +'?" name="middle" target="_self" scrolling="auto" />'
    + '</frameset> />'
    + '</frameset> />'
    + '<frame src="right.php" name="right" scrolling="no" />'
    + '<noframes>');

  2. #2
    Join Date
    Jul 2005
    Try window.location.href instead of window.location.
    Bitter web veteran

  3. #3
    Join Date
    Oct 2009
    Thanks for reply Webnerd, but this doesn't work.
    It does execute the query with windows.location.href, but now the frames around it are not loaded

    Any suggestions how to change this?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center