Jump to content

paulclift

Members
  • Content Count

    34
  • Joined

  • Last visited

Community Reputation

0 Neutral

About paulclift

  • Rank
    Newbie
  1. I have an autocomplete() function connected to a MYSQL database. The jquery is completely run of the mill: $(function() { $(".choose_venue").autocomplete({ source: "list_venues.php", minLength: 1 }); }); ...and if I manually add a query such as "list_venues.php?term=Ku" onto the URL of list_venues.php, then that page gives a appropriate response (such as the following): [{"name":"Fonderie Kugler"},{"name":"Kulturhaus Helferei"},{"name":"Kunstraum Walcheturm"}]So, a simple `input` such as the following *sh
  2. @justsomeguy Thanks for your response. I am not particularly knowledgable with JS .... could you describe your solution in a little more detail please?
  3. I am displaying data from one page in another page in the following way: <script> $(document).ready(function(){ $( "#2017" ).load( "data.html .2017" ); $( "#2016" ).load( "data.html .2016" ); }); </script> <div id="2017"></div> <div id="2016"></div> ...BUT I also need to be able to hide (onload) certain div classes from within the linked file... <script> $(document).ready(function(){ $('.private-files').hide(); }); </script> I know that the code above will hide divs by class
  4. Thanks justsomeguy, but this seems to be something which is in development and does not quite suit my needs in this specific case..
  5. Hey all, I have a language switch on a website which updates the displayed language in the main iframe. However, I am also using fancy box, which pops up out of the iframe, and is therefore an iframe within an iframe. I change the language to be displayed with the following code: function setlang(lang) { var i; var len; var list; var ifr = document.getElementById('mainframe'); var cw = (ifr.contentWindow || ifr.contentDocument); list = cw.document.getElementsByClassName('langdiv'); for (i=0, len=list.length ; i<len ; i++){ list.style.display = 'none'; } list = cw.document.ge
  6. I was wondering if someone could come up with a way of using the current date to set the position of a div. I would like to apply such a process to this page: http://www.paulclift.net/news.html The object in question which I would like to move automatically up and down, so that it is in the appropriate place relative to the other items on the page, is the three HR lines with past/future written above & below it. There must be a way to do this - not having to constantly move this object, and others like it on other pages, would be a huge time-saver! Please help if you have any i
  7. Just realised I never thanked you for this, justsomeguy - so thanks very much - your code really helped me out a lot!
  8. AHHHH yes, the '.' before 'contentWindow' ..... now we're in business
  9. I think perhaps that it would be better just to switch to an 'if' and 'else' .... your thoughts?
  10. With this code: <script> function setlanguage(language, n1, n2, n3) { var ShowLang = document.getElementById('mainframe').contentWindow.document.getElementsByClassName(language); for(var i = 0; i < ShowLang.length; i++) { ShowLang.style.display='none'; } var HideLang = document.getElementById('mainframe')contentWindow.document.getElementsByClassName(n1); for(var i = 0; i < HideLang.length; i++) { HideLang.style.display='none'; } } </script> ...I get the error message "SyntaxError: Expected an identifier but found 'contentWindow' instead" for
  11. hmmm it seems that having two 'for's or two 'var's in my function is causing the problem...... I thought that that was okay?
  12. Thanks for the help...... that's good for a start, but I noticed that if I replace 'n1' with, for example 'IT', those divs still don't disappear from the page loaded inside the iframe..... I cannot understand why that part is not working!
  13. I noticed that other people seemed to have gotten the above javascript running with a 'getElementById' rather than by ClassName....... but surely that would not stop it from working.... Also, I know that an 'if' and 'else' inside the function would be rather more elegant....
  14. So the following seems promising, but is not working for me for the moment: <script> function setlanguage(language, n1, n2, n3) { var ShowLang = document.getElementById('iframe').contentWindow.document.getElementsByClassName(language); for(var i = 0; i < ShowLang.length; i++) { ShowLang.style.display="block"; } var HideLang = document.getElementById('iframe')contentWindow.document.getElementsByClassName(n1, n2, n3); for(var i = 0; i < HideLang.length; i++) { HideLang.style.display="none"; } } </script> <body>
  15. Hmmm is that right? I was looking for other instances of this and got the impression that it was possible..... my other thought was to use sessionStorage and pass the value to the iframe documents, but if you could simply control the iframe pages from the index.html it would be much cleaner....
×
×
  • Create New...