Jump to content

iwato

Members
  • Posts

    1,506
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by iwato

  1. So, it is false the first time around, performs the else-statement, loops through again, but on the second loop is a true expression. Is this it? Roddy
  2. Dsonesuk, what I understand from the discussion thus far, is that you believe that I know next to nothing about the use of margins and padding. Your criticism is well taken, since I am not completely comfortable with them. Still, I can use them quite successfully at times. It is also surely true that my webpage has been built in piecemeal fashion over a very long period of time. Had I known everything, that I know now, when I began, I surely would have built it differently. This confession, however, does not help me with my current dilemma. The DILEMMA: Although it is true that the middle section of my webpage is filled in a variety of ways, the end result is always a replacement of the current content of the #main div. Where this content comes from and in what viewport it is viewed has, unfortunately, resulted in major confusion in alignment. Now, you have been very helpful in the past, and if I have taken your goodwill for granted, I deeply apologize. Can you be clearer in your solution? Roddy
  3. ACKNOWLEDGMENT and RESULTS: Let me begin by announcing my success in having merged Matomo and wordcount2.js into a dynamically loading word cloud that reflects visitor use of Grammar Captive's local search engines. It is a little slow in loading, but unfortunately everything related to Matomo is slow at this point -- this, despite my recent server upgrade that has sped everything up. If you would like to see the result, simply click on the menu option Word Cloud under Visitor Profile in the navigation bar on the Grammar Captive mainpage. And, now back to Javascript. Thank you everyone for your effort. BACKGROUND: In an effort to distinguish between visitor desire and Grammar Captive's ability to meet this desire, I am seeking to create another word cloud that measures only visitor behavior. The aforementioned word cloud reflects a matching of visitor desire with Grammar Captives ability to match it. It is not a true reflection of visitor desire. In order to achieve this latter I must count not the number of hits that visitors receive when they make a search, rather I must count the number of searches for a particular item. In order to do this I found a function on Stack Overflow that will likely be of help, if only I could understand it. The FUNCTION: function checkDuplicateInObject(propertyName, inputArray) { var seenDuplicate = false, testObject = {}; inputArray.map(function(item) { var itemPropertyName = item[propertyName]; if (itemPropertyName in testObject) { testObject[itemPropertyName].duplicate = true; item.duplicate = true; seenDuplicate = true; } else { testObject[itemPropertyName] = item; delete item.duplicate; } }); return seenDuplicate; } MY QUANDARY: The condition of the above function's if-statement appears to be self-defeating. Still, the function works, for I have tested it with my own data. Specifically, the variable testObject appears to contain an undefined object. It would appear then that the condition of the if-statement would always return false. As this is definitely not the case, I am at a loss as to how to interpret the condition. QUESTION: How is it that testObject can be empty and the condition still return true? Roddy
  4. It turns out that Matomo updates the tracking script on a a regular basis, else it could not be recording the events that it has recorded in the absence of repeated use of the tracking script. Thank you for making it clear that this option exists. Roddy
  5. It appears that Dsonesuk has no patience for amateur developers. It is unfortunate, because he has such a good understanding of CSS and working with CSS is sometimes very difficult. Roddy
  6. I have managed to get wordcloud2.js to interact effectively with the Matomo database. Very soon Grammar Captive will have its own word cloud. Thank you! Roddy
  7. I have actually tried to remove the pop-up for repeat visitors on several occasions, but have yet to succeed in the task. This said, it only takes two clicks to remove and the first pop-up is a genuine "Hi!". I do thank you for your suggestion and someday I will surely achieve the task. For the moment, however, I find proper alignment of my div tags in my iPhone viewport more important, and truly hope that it does not dissuade you from offering further suggestions in this regard. Roddy
  8. dsonesuk: What is obvious to you is not obvious to me. I have taken your suggestion with regard to the negative margins and the appropriate place to change the width of my middle panel as suggested by the Furtive Fox. All of this combined has mostly resolved the problem of the middle section on my computer's Firefox and Chrome browsers when the width of the viewport is changed. You can check the results by opening to the Grammar Captive mainpage and clicking on the About and Free Consultation menu options under the heading Introduction in the navigation bar. What I have sacrificed in so doing, however, is the alignment in my Safari browser on my iPhone for the same main div panels and other similarly constructed main div panel inserts. Now, perhaps you can better understand what I meant by the title word Juggling. Surely, this problem can be overcome without my having to redesign my entire webpage. Well, at least, it is my hope. Roddy
  9. OK, Dsonesuk, it fixes the problem in my browser window, but creates a problem on my iPhone. Is there a way to achieve the same goal on both apparati? Roddy
  10. Is it possible for the Matomo application to trigger the Javascript? Let me provide a more concrete example of what I mean. On the Grammar Captive mainpage is a standard Matomo tracking script that appears as follows: <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//.../matomo/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', '1']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> Indeed, the above script is on every webpage whose visitor behavior I wish to track. On the mainpage in particular various events are triggered using Javascript after the page has loaded. Each of these events includes a piece of code similar to the following: _paq.push(['trackEvent', 'Gate One', 'Click', fileName]); The consists of the pushed array element consist of a Matomo method called trackEvent(). Associated with each such event are three parameters used to identify the event. Now, with the exception of the four standard Matomo methods that fill the _paq array when the page is first loaded, every additional event triggered by Javascript and containing a _paq.push({...}); statement occurs after the page has been loaded. Does this imply that these latter events will not be properly tracked unless I reload the first script with each and every new triggered event? Roddy
  11. OK. It appears that I have been able to salvage my intended format with a minimum of secondary, negative effects. What I cannot seem to achieve, however, is uniformity in width among my center panels. Please perform the following experiment. The EXPERIMENT After opening to the Grammar Captive mainpage proceed to the navigation bar and find two menu options: About and Free Consultation! Click on each and notice that the background color does not fill across the entire width of the center panel. QUESTION: What is prohibiting the background color from filling the entire width of the center panel? Roddy
  12. DILEMMA: Using Javascript with Matomo to track events is somewhat elusive. This is because the Javascript that communicates with the Matomo application is generally placed on a visitor-friendly, visible HTML document, while the events that one wishes to track are often triggered by Javascript after the page has loaded. QUESTION: In light of the above,. when Javascript is called after a page has loaded is the Javascript that loaded with the page called again? Or, is it only the Javascript that was called after the page has been loaded? Roddy
  13. Your observation makes good sense until I try to adjust the following media rule to accommodate for the gap. It has no effect. /* for 700px or less. Note: It was previously set to 600px. */ @media screen and (max-width: 700px) { #content { width: auto; float: none; } #middle { width: auto; width: -moz-auto; float: none; margin-left: 0px; } #sidebar { width: auto; width: -moz-auto; float: none; } }
  14. WHO: A problem for Dsonsuke. BACKGROUND: In a recent effort to make my website responsive, I have run into trouble with my website. DILEMMA: I have five panels that appear correctly in two (wide viewport and narrow viewport) of three instances (wide viewport, middle viewport, and narrow viewport). It is the middle viewport that I cannot get to appear correctly, and I do not know what is causing the problem. When one adjusts the browser window from wide to narrow, and the three horizontally aligned panels are reduced from three to two, the contents of the middle panel is no longer centered and the left-margin appears exorbitantly large. Please see, the Grammar Captive mainpage before commenting. Roddy
  15. OK. Then you appear to agree with the following: But then, how would you interpret the meaning of {list: list} in the above statement? Is the first list the name of an object property called list, and the second list an array called list of the form [['foo', 12], ['bar', 6]]. Is it just this simple? Roddy
  16. Yes, but what is the format of the resulting list? 1) Is it pairs of elements separated by commas in a single line. [count] [search string], [count] [search string], [count] [search string], ... [count] [search string] \n 2) Is it pairs of elements separated by line breaks? [count] [search string] \n [count] [search string] \n [count] [search string] \n ... [count] [search string] \n Also, how does Javascript recognize a list as a list? Is everything closed in parantheses? Is there a special method that constitutes a list from either of the above two formats. Then too, what happens, if the search string is composed of multiple words? It is not as simple a problem, as it would first appear. Well, at least not for me, at any rate. Roddy
  17. No, I have not forgotten. Simply, I believe that I have found a way to avoid the problem. Use a technique that does not depend on jQuery. BACKGROUND: I have discovered a Javascript package called wordcloud2.js. In order to run this I need to create a list. in preparation for this moment I have managed to create an array of objects from the Matomo database that contain the information needed to create the list. Each object in the array takes the following form: category: "Site Search / [category]" count: "[number]" target: "[search string]" where the information contained in the brackets are the values of the respective properties of each object. The array takes on the following appearance: array {object, object, object, ..., object) THE GOAL: Create a list of the following format. [number] [search string] [number] [search string] [number] [search string] ... [number] [search string] DILEMMA: Now, there is plenty of information about how to create objects and arrays from lists. I need to know how to do just the opposite. Roddy
  18. BACKGROUND: While I continue to struggle with my wget problem, I would like to reaffirm a discussion that we had already two or three months ago about the use of hash marks in an HTTP Request query string. Please consider the following HTTP Request copied from a Matomo API request generated by Matomo. I only initiated the request, I did not create it. https://www.nudge.online/_utilities/php/matomo/index.php ?module=CoreHome &action=index &idSite=1 &period=day &date=yesterday #?idSite=1 &period=day &date=yesterday &category=General_Actions &subcategory=Actions_SubmenuSitesearch Is it not likely that the above request is one request riding piggy-back on another that upon arrival get split and are made into two separate requests? If my interpretation is indeed accurate, then why make the initial request at all, as it appears to add no new information. Why not just write and send the following: https://www.nudge.online/_utilities/php/matomo/index.php ?module=CoreHome &action=index &idSite=1 &period=day &date=yesterday &category=General_Actions &subcategory=Actions_SubmenuSitesearch Any ideas? Roddy ps: I know it seems silly to have to post these questions at W3Schools, but this reflects the desert of support that Matomo offers while making its software free to the general public. Although it is surely true that beggars should not be choosers, how can one possibly expect to promote one's software without providing even the most minimal support needed to make it work!
  19. Thanks, JMRKER! I have copied your script into my Javascript notes. It will make it easy to remember, should I ever forget. :-) Roddy
  20. BACKGROUND: Having upgraded my server I now have full command of the UNIX terminal. Although a good thing, my first attempt to make use of it has failed. The following code was used to access the Matomo application which resides on the same Lunarpages VPS server as the PHP routine that calls it -- albeit from a different domain name. The CODE: <?php ini_set('log_errors', 1); ini_set('error_log', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'error.log'); ini_set('html_errors', 0); ini_set('display_errors', 0); error_reporting(E_ALL); exec('wget --http-user=[...] --http-password=[...] -P /tmp/ -p -k https://.../index.php?module=Widgetize&action=iframe&containerId=GoalsOverview&widget=1&moduleToWidgetize=CoreHome&actionToWidgetize=renderWidgetContainer&idSite=1&period=day&date=yesterday&disableLink=1&widget=1&token_auth=[...]'); ?> When I examine the Response panel in the Network Menu of Firefox, nothing appears. This said PHP does not complain and the Headers panel returns an HTTP Request code of 200. When I run the same wget command in terminal I am able to generate an HTML file, but the contents tells me that the Matomo API responsible for generating the desired widget is not accessible. The error message reads, Any suggestions? Roddy
  21. No, i have not. I thought I would check first, before I start writing. The variable is declared earlier in the routine. I will try it now. Thank you! Roddy
  22. GENERAL QUESTION: Can variables created outside of a function be used within a function without having to read them first as arguments of the function? If so, can a function created within a function use a variable created outside of both functions? CODE var dataString = 'search_input=' + search_letter_input; $.ajax({ type: "POST", url: './...', data: dataString, dataType: 'JSON', statusCode: { 404: function() { alert( "Page not found" ); }}, success: function(jsonData) {...} }); SPECIFIC QUESTION: I would like to use the value of the variable search_letter_input in the success function of the $.ajax( ) method. Is this possible? Roddy
  23. The bizarre character has magically disappeared, but with not without a trace. For, I now see where a correction that I made in regard to the coding of the Gate Seven webpages has likely made a difference. For now, Gate Seven is working appropriately, but the Gate Seven data still appears under Gate Two. I will likely have to go into the Matomo database and remove it manually. The magical nature of what has occurred is apparently created by a Matomo time lag. What it calls today is actually yesterday. Another Matomo mystery that I will someday have to address. In any case, I am not as bad a coder as I sometimes think myself to be. Then too, it was never my goal to become one. I am becoming one by default. If Grammar Captive does not sail, then I can write code manuals and help others to overcome the frustration that Matomo has created for me. Have a great day! And, once again, thank you for your patience. Roddy
  24. Yes, in part. The matter, however, is more complex. It is not only that the arrays for the Gate Seven query are returned empty, but that they are returned at all. For, the queries for each of the other gates return two objects and an array, rather than three arrays. Then, there is the more recently discovered confusion about the queried data: although a portion of the data for Gate Seven is returned, it is returned with the query for Gate Two. It is all too bizaare! Roddy
  25. Yes, the code and the associated URL and query string are what create the series of objects and arrays in the uniform pattern expected up until the data for Gate Seven is requested where upon three empty arrays appear instead of two filled objects and one filled array. Please follow the links that I provided and read my commentary else you will be stabbing in the dark. Roddy
×
×
  • Create New...