Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search

TempusInfernus

Circle Member
  • Content Count

    14
  • Joined

  • Last visited

Recent Profile Visitors

102 profile views
  1. OK, apologies, that had me confused. Though, I'm not sure how helpful the URL to my site will be, as the the code I wrote here based on what you said in your first comment isn't live on the site because when I tried it, it didn't seem to work, but I did put what I had tried into a code quote comment here changing the name of the function from "customCode" to "pageRedirect" It's pretty simple - it's just a bunch of different page redirects. window.location.href being passed the variable of "url" for multiple placeholder pages It's probably not the best way to do it, but it's the only
  2. Huh? I specifically provided my site URL multiple times in this thread, in both posts and in the code I provided that is live on my site... AND in the hypothetical code I wrote based on what you mentioned here... To reiterate - it's goldenhourgraphics.com Since I specifically said less than 24 hours ago and only one comment before you replied that I didn't provide my site url... I'm not understanding why you would say that I didn't provide my site URL - it's right there.
  3. <script type = "text/javascript"> var url = "https://www.goldenhourgraphics.com/a-page-on-the-site"; function pageRedirect() { window.location.href = url; } document.write("Navigating to the correct page"); setTimeout('pageRedirect()', 0); </script> This is what is in the code blocks on each page. According to what you posted above... I would interpret what you said to mean that what I should inject into the overall headers across the site would be this: <script type = "tex
  4. I tried that (the exact code you posted here) but nothing seemed to happen... It didn't work at all. ( I put it into the header injection for the whole site ) The part I don't know how to write is the "customCode" function which you left unwritten here. The question I am asking is how to write a function that calls a different variable every single time it is called over and over from a different page (as part of a code block) where I want the function to do something different each time... e.g. I want the page to redirect differently each time, and not at all the first time it's c
  5. Squarespace AJAX page loading kills scripts on page. They will not load without a page refresh. Code written to every page initialized with the redirect value will just cause a redirect loop... How do I write a script that doesn't redirect the page initially that is in the header and LISTENS for an AJAX page refresh... and THEN gets reinitialized with a new value to redirect the page? (I've actually asked this question already but my posts aren't getting answered at all, so I'm starting to wonder what the coding and customization board is for if one can't ask a coding and customizatio
  6. My understanding is that I cannot simply insert code into the header or a code block because my squarespace 7.0 template (jasper jin) uses AJAX and so does not reload the page. I like the AJAX, I don't want to disable it. How do I set up an event listener or something to make it so that a code block or header script tags WILL be fired when that part of the page loads? I don't want to disable ajax and I'm not an javascript expert but this seems like it should be simple code if I can get it to work even once. Any AJAX experts that can tell me how to write this basic two-part script... ?
  7. Something like window.location won't work because of the squarespace AJAX mercury loader not being coded to check for new javascript when there is a page change and I am not a javascript expert but with a little help might be able to implement something... Is there a way to set up a site-wide event listener so that I can trigger an individual page to redirect via either a page specific header injection or an event in a code block?
  8. So what I have gathered is that I actually need to so some kind of sitewide code injection to set up a listener for when there is any kind of an AJAX refresh which will reinitialize the function... The problem is that the function I want is a page redirect... So I understand THIS code is what I would want as part of a SITEWIDE code injection... continued below... <script> (function() { // Establish a function that does stuff. var myFunction = function() { // Do stuff here. }; // Initialize the fn on site load. myFunction(); // myFunction2(); , etc... //
  9. I should mention that I am doing this in a specific "Page Header Code Injection" but when I load the page and view source... I don't even see this code... I have definitely saved the page. Has page header code injection been removed from SquareSpace but the menu option still exists or something?
  10. <script> window.Squarespace.onInitialize(Y, function() { location.assign("https://www.squarespace.com"); } ); </script> If I inject this code into the header of a page, shouldn't the browser be directed to squarespace.com...? Nothing happens... Any ideas why? Is my code wrong?
  11. This is driving me CRAZY. I just want two little icons side by side in the footer that don't become HUGE on mobile. How damn hard does this have to be?
  12. You can run javascript in the code block - just make sure you are not still in edit mode. (when you flip to preview mode it runs - for example a widget embed will show up) I made this mistake struggling for about 2 hours the other day and when I figured it out, I wanted to smash my head into the desk for an equal amount of time.
×
×
  • Create New...