SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 41 of 41

Thread: Popups

  1. #26
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and once again 'java script' should be javascript I belive.

    wierd why vB splits it up!
    - website

  2. #27
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by website
    and once again 'java script' should be javascript I belive.

    wierd why vB splits it up!
    i believe it does it as a security measure.
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #28
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by weirdbeardmt
    i believe it does it as a security measure.
    man, that is just silly, they have gone too far now I think...
    - website

  4. #29
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a test though - in the event that [object] is due to you using a link - and this that follows will give a true/false answer if it's something to do with your link.

    Instead of using a link use a button instead and have a look at the parent window to see if [object] if there or not.

    If not then it's your link that's f***ed 8)

    BTW - I mean the HTML button and not a FORM button 8)

  5. #30
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by website
    man, that is just silly, they have gone too far now I think...
    its been like this since well erm.. since years ago actually. and its quite easy to get round once you know about it
    Regular user

  6. #31
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and its quite easy to get round once you know about it
    and how would that be?
    its been like this since well erm.. since years ago actually
    well, havn't had a long experience with vB but this is still... stupid
    - website

  7. #32
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    well everytime your saw the word jav script with a space you would know that it was supposed to be one word ... its a bit like writing & n b s p ; and knowing the you ahve to include the spaces

    anyway we disgress back to Dean's problem.
    Regular user

  8. #33
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Visual Basic ? What do you expect from Microsoft ? LoL...

  9. #34
    SitePoint Evangelist Deano's Avatar
    Join Date
    Mar 2003
    Location
    Derbyshire, UK
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all, ok website here's the full script :
    PHP Code:
    <?php
      
    // includes
    include("conf.php");

    // open database connection
    $connection mysql_connect($host$user$pass) or die ("Unable to connect!");

    // select database
            
    mysql_select_db($db) or die ("Unable to select database!");

    $ocnews = @mysql_query('SELECT ID, headline, DATE_FORMAT(date,\'%W %D %M \') AS realdate, content, author FROM ocnews ORDER BY author DESC LIMIT 5'); 
    if (!
    $ocnews) { 
    die(
    '<p><font color="red" size="2" face="Arial, Helvetica, sans-serif">Error retrieving news from database!</font><br />'
    'Error: ' mysql_error() . '</p>'); 


    while (
    $author mysql_fetch_array($ocnews)) { 
           
    $id $author['ID']; 
           
    $headline = ($author['headline']); 
           
    $date $author['realdate']; 
           
    $content = ($author['content']); 
           
    $author = ($author['author']); 
     echo ( 
    '<a href="article.php?id=$id" target="_blank" onclick="window.open( this.href, this.target, \'width=400, height=455\' ); return false;">
             $headline</a><img src="News/images/spacer.gif"width="10" height="4" border="0">$date<br>'
    );  
    }

    ?>
    Link to the script currrently on my server !
    http://www.ops-centre.co.uk/squadron...headlines3.php

    If i change the " to ' then I lose the new window format IE no scrolbars etc.

    cheers Deano

  10. #35
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Um have you tried it with " not ' (double quotes in single quotes) as I thought php only parsed values with double quotes?

    PHP Code:
    echo ( "<a href=\"article.php?id=".$id."\" target=\"_blank\" onclick=\"window.open( this.href, this.target, \"width=400, height=455\" ); return false;\">".$headline."</a><img src=\"News/images/spacer.gif\" width=\"10\" height=\"4\" border=\"0\">".$date."<br>");   

    like that?
    Regular user

  11. #36
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    quick test it works for me - obviously I am not using your sql query but putting in a set $id=14 just before it and it works just fine?!?
    Regular user

  12. #37
    SitePoint Evangelist Deano's Avatar
    Join Date
    Mar 2003
    Location
    Derbyshire, UK
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx sarah !

    I'll try to add the new window formating now IE noresize etc

    Best Regards
    Deano

  13. #38
    SitePoint Evangelist Deano's Avatar
    Join Date
    Mar 2003
    Location
    Derbyshire, UK
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well the script finally works as required, here's the echo just incase someone else is having a simular problem,

    PHP Code:
    echo ( "<a href=\"article.php?id=".$id."\" target=\"_blank\" onclick=\"window.open( this.href, this.target, 'width=400, height=455, status=no,scrolling=no,resizable=no,scrollbars=no' ); return false;\">".$headline."</a><img src=\"News/images/spacer.gif\" width=\"10\" height=\"4\" border=\"0\">".$date."<br>" ); 
    Here's the link to see it in action :

    www.ops-centre.co.uk/squadron/News/headlines.php

    Thx for all your help folks !

    Best Regards
    Deano !
    Last edited by Deano; May 1, 2003 at 11:00.

  14. #39
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, but another issue that you'll need to address is that every time you click on a link the news opens up in a new window.

    I clicked over all 3 and I had 3 windows 8)

    What you'd need to do is give your window a name and check for this first before you open a new window.

    You might want to look at www.javascriptsource.com for more on pop up windows ?

    Just a thought nothing more 8)

  15. #40
    SitePoint Evangelist Deano's Avatar
    Join Date
    Mar 2003
    Location
    Derbyshire, UK
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx Dr

    If you wouldnt have pointed this out i would never have noticed.

    I will look into this and post the finalised script again

    Best Regards
    Deano

  16. #41
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hope this helps ?

    PHP Code:
    What happens if we execute the window.open() method twicewith the same sName argumentLike HTML-generated windows, if you specify the name of a window that already existsopen() simply uses that existing window rather than opening a new oneTake a look at the following script:

    window.open("[url=http://www.javascript.com/]http://www.javascript.com/[/url]""win");
    window.open("[url=http://www.docjs.com/]http://www.docjs.com/[/url]""win");
    If 
    you execute these statementsthe browser opens a new window named "win" to display the [url=http://www.javascript.com]www.javascript.com[/url] page. But the second statement then replaces the URL of the new window with [url=http://www.docjs.com]www.docjs.com[/url]. The following statements generate two different windows to display these Web sites:

    window.open("[url=http://www.javascript.com/]http://www.javascript.com/[/url]""win1");
    window.open("[url=http://www.docjs.com/]http://www.docjs.com/[/url]""win2");
    Go ahead and run these statementsThe browser opens two new windowsThe first onenamed "win1"loads the URL [url=http://www.javascript.com]www.javascript.com[/url], while the other window, named "win2", loads the URL [url=http://www.docjs.com]www.docjs.com[/url]. Note that [url=http://www.docjs.com]www.docjs.com[/url] is the same as [url=http://www.webreference.com/js]www.webreference.com/js[/url].
    If we don't specify a name for the new window, the browser automatically launches a new window. The same applies to the name "_blank", but an empty string is another story. There are several important differences between Internet Explorer and Navigator: 
    Something I picked up from webreference a while back on using windows and Javascript.


Bookmarks

Posting Permissions

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