Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    code to get javascript to open in a new window

    Hi everyone

    I am a newbie with respect to programming and this is my first post

    I have a small problem, probably very basic to everyone except me, and would appreciate and value your advice

    I have entered below a javascript I am using on my website. This script is designed to automatically insert videos based on keywords and works perfectly except that my visitors are taken away from my website when they use it.

    Can someone please tell me what code to insert, and where, in order get the script to open in a new page.

    I am aware how to do this in html using target ="blank" but do not know how to do it in javascript.

    Thankyou in anticipation, the code I am using is below:

    Code:
    <!-- BEGIN HostDomain -->
    <div id="HostDomain_DivId"> </div>
    <script src="http://app.HostDomain.com/script/HostDomainUtils.js">
    </script>
    <script language="JavaScript" type="text/javascript" src="http://app.HostDomain.com/script/widgetTy pe/carousel/ptContentflow.js" load="fancyScrollbar">
    </script>
    <script type="text/javascript">
    /* Do not change the values given below. */
    var HostDomain_Organization_Name = "MySite";
    var HostDomain_Organization_ID = "xxxxxxxx";
    var HostDomain_Feed_ID = "xxxxxxx";
    var HostDomain_DivId = "HostDomain_DivId";
    var HostDomain_AppServerPath = "http://app.HostDomain.com";
    </script>
    <script src="http://app.HostDomain.com/script/HostDoma in.js">
    </script>
    <!-- END HostDomain --></font></td>

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,028
    Thanks
    75
    Thanked 4,325 Times in 4,291 Posts
    No place in the code you showed us is it does it "insert a video".

    Clearly, the code is inside one of the ".js" files, but we can't modify it without seeing it.

    I'm pretty sure we can assume it's not in the ptContentflow.js file, but it could be in either of the others.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Old Pedant

    Many thanks for your reply

    This script pulls videos from Youtube.

    I have actually used it on one of my web pages and have looked at the page source there and, by clicking on the script source shown there, have been able to access the full script which is very long and way too complex for me to understand

    I personally have no objections to you looking at this and would be hapy to send you the access details provided that I would not be contravening Forum Rules by doing so. However I would not wish to edit the script in any way without the permission of the script owners.

    In my ignorance I thought there might have been a way (as in html) of adding a little bit of code to get the "open in new window" action I desired but maybe this is not possible.

    If there is any further way you can help that would be great, if not then many thanks for your help so far.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,028
    Thanks
    75
    Thanked 4,325 Times in 4,291 Posts
    You can certainly pm me if you wish.

    It's *possible* we could do this without altering their code. But only if *EVERY* person gets some kind of video. What we *might* be able to do is move all of the relevant code (and I still don't know what parts are relevant) into a popup window. But that would be a poor solution if some people do NOT get a video, as then they'd get this blank popup.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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