_info.html in settings.php

edited March 2013 in Troubleshooting
Hi,

I have changed the _info.txt to _info.html in config/settings.php. I wanted dynamically change the a href ="#" to a href="http://amsegen.com/specials/ghPrints/index.php" by jquery, but it is not working. I have put:
Not sure why are the javascript or jquery not working at all?
At this url at http://amsegen.com/specials/ghPrints/index.php, you can click on 1960s, then clicking on the place order button should take user to the url(http://nba.com) in the jquery script. Was there anything I did wrong?

Any helps gratefully thanks for your advise!

Beckmann

Comments

  • edited March 2013
    Why don't you just assign the link the right way?

    What are you trying to archieve with the posted javascript?
    Btw you should execute it like this:

    $(document).ready(function(){
    //what ever you want to be done after the document is loaded
    });

    and change you img tag in _info.html to the relative path (../Cast_Photo_1969.jpg)
  • edited March 2013
    Hi Sebastian,

    The reason I want to make a simple hyperlink "Place order" in the 1960s/ _info.html to be dynamic due to other gallerys (1960s, 1970s, 1980s, 1990s, 2000s etc..) are sharing the same this hyperlink "Place order" to land on the other website which contains the shopping cart. Once the url of web site gets changed, I only need to change one file, in this case I only can use javascript or jquery, because the _info.html not like _info.shtml or _info.php which are sharing files could share the include file. But _info.shtml and _info.php don't work in minishowcase. Not sure I am making the question clear enough for you or not?

    I have just followed your instruction to put the document ready statement into the javascript block, it is not working. So my question is can javascript work in the _info.html page? You can find the code in the _info.html by view source code for the javascript.
    The link is at http://www.amsegen.com/specials/ghPrints/index.php

    Thanks a lot for your responses,

    Beckmann
  • edited March 2013
    Hey Beckmann,

    then you should put this into the start of your libraries/ajax.functions.js in setCurrentPosition():
    $j("#orderBtn").attr('href', 'http://www.example.com/index.php?data=' + sendEncoded(active_img.sq(),'url'));
    if (show_permalink) {
    ...
    }


    and if you are using the the permlink you can access the current_link variable in there.

    I'm not sure whether the $j jquery is available or not - just check it out.

    This should also be useful for your other "in gallery order buttons" ;)

    edit: fixed the selector
  • Thanks Sebastian, I will try it and let you how it goes.

    Beckmann


  • You can change the link without jQuery ;)
    document.getElementById('orderBtn').setAttribute('href', 'http://www.exmple.com');
  • edited March 2013
    Hi Sebastian,

    I have followed your instruction to put the code there. I can see the text paragraph is gone and the button "Place Order" didn't go to anywhere when I click on 1960s or 1970s etc... at http://amsegen.com/specials/ghPrints/.

    This is the code at ajax.functions.js below:

    function setCurrentPosition()
        {
            $j("#close_win a").attr('href', 'http://www.nba.com'+ sendEncoded(active_img.sq(),'url'));
           
            if (show_permalink) {
               ...}

    Not sure what is it suppose to do with _info.html page? Basically I wanted to have a shared button "Place Order" to be placed on each _info.html page which I can modify this hyperlinked button at one place instead of going thru each _info.html pages. If I have 50 galleries and have 50 _info.html page, once the url of hyperlink changed on one _info.html page, I need open 50 times of _info.html page to make the change, because the "Place Order" link goes to the same website. That was why I tried to find out a dynamic way to avoid making the change for each _info.html page. Unfortunately the the actual javascript and jquery on the _info.html page are not working. Does it make sense to you?

    Please let me know if my question is not clear enough for you?

    Much appreciated!

    Beckmann
  • Hi Sebastian,

    I have put the pure javascript on the _info.html page, it is not working. I started to think javascript and jquery won't be allowed in the _info.html page. Then I have to manually change each _info.html page, it is real intense!

    Thank you,

    Beckmann
  • sent you a pm
  • you can try putting your javascript below your <table>.
    get rid of the onload function and access the button like posted above ;)
  • Like:
    <table>
    <tr><td>...</td></tr>
    </table>
    <script type="text/javascript" language="javascript">
    document.getElementById('orderBtn').setAttribute('href','http://nba.com');
    </script>

    or:
    <table>
    <script type="text/javascript" language="javascript">
    document.getElementById('orderBtn').setAttribute('href','http://nba.com');
    </script>
    <tr><td>...</td></tr>
    </table>
    Is that what you meant?

    Thank you,

    Beckmann
  • edited March 2013
    the first one.
  • No luck after I made that change at http://amsegen.com/specials/ghPrints/index.php.

    Thank you,

    Beckmann
  • edited March 2013
    Hello Beckmann,

    your problem should be sorted out really easily.

    You've got a few problems adding my code.

    In libraries/ajax.functions.js: the selector you've inserted into "setCurrentPosition()" is
    wrong. Please change this.

    Otherwise you should also update your styles/gallery.css according to fix the spinner not loading correctly

    Best regards

    Sebastian
  • Hello Sebastian,

    Could you please show me the correct syntax to change libraries/ajax.functions.js? Is it the change associating with my original question "making a include file for _info.html"? As you see, I tried to put the javascript on the _info.html page, but it doesn't work. I tried to use jquery or javascript to make some changes for the dynamic menu like $(document).css('color','red');for '2000s', but not working at all.

    Best regards,

    Beckmann
  • edited March 2013
    oh im so sorry to misslead you.
    I missinterpreted the including functions...

    you have to change this in libraries/ajax.functions.js in the function updateData(request)
    if (result != 'null') {
    innerhtml('gallery_description', result);
    display('gallery_description','block');
    }

    to
    if (result != 'null') {
    innerhtml('gallery_description', result);
    display('gallery_description','block');
    document.getElementById('orderBtn').setAttribute('href', 'http://www.nba.com/' + sendEncoded(active_img.sq(),'url'));
    }

Sign In or Register to comment.