Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.
Twitter,
Facebook, or email.
JQuery not working on refresh/new page.
I'm working on an extension and the jquery doesn't seem to work after its first use. If I save a change the query works fine, but if I then refresh the page or open a new one without changing anything in the extension, the jquery has no effect. Any ideas? Thanks!
-
Hello Dustin,
I understand that you are having an issue with jQuery in your extension. Usually, this works without problems and hence in order to assist further I need to take a closer look.
Therefore, please provide as much of the following information as possible and I will investigate:
- The extension id
- The file/line number where the code snippet can be found
- Which browser and operating system you are testing on, including version numbers
- The exact steps for reproducing the problem
- Any additional useful data, such as URLs, screenshots, videos, ...
-
-
Extension ID: 73513.
File: extension.js. Line Number 77. The function in Line Numbers 52 to 66 is also an example of the error.
Testing on Windows 7, Google Chrome Version 41.0.2272.118 m
To recreate the problem:
If you download and install the app, it should work correctly (currently, this means a sidebar will pop out reading "This is a test! This is ONLY a test!") and there's an extra little tab at the top for opening and closing it which works (actually, as a side note, the default tab to open and close the sidebar doesn't appear on https pages, is there a way to fix that?)
However, if you then refresh the page, or visit another page, the sidebar will still pop out normally, but it will display the default message "Hey", and the extra open/close tab at the top will no longer function. I have noticed that the extension seems to load faster on successive uses, which may have something to do with it, although whether it's a contributing factor or a side effect I'm not certain of.
Thanks for the help!-
Hello Dustin,
Apologies for the delay in replying ... I installed the extension and can see the default message in the sidebar. However, the rest of you test code requires access to page restricted by log in. Please provide the test credentials by emailing support@crossrider.com with a reference to this thread and I'l take a look. -
-
-
-
-
Thought I had removed that. Okay, updated the extension, it should now work on any page.
-
So, just t clarify, you want to change the text in the sidebar after it's opened.
From the code I can see the sequence of events are:
1. load sidebar
2. get html from resources
3. update sidebar text
However, you have 2 async actions (items 1 and 2) happening and there is not guarantee which will complete first. If you add a setTimeout with a reasonable delay around items 2 and 3, I think you'll find it will work every time.
More importantly, what are you trying to achieve? From what I can see the current approach is a viable solution. If you prefer to keep this private, feel free to email support@crossrider.com and I can help you there. -
-
-
-
Loading Profile...




EMPLOYEE
