0

here's my situation:

  • I have an ASP.net website I'm working with
  • I have JQuery loading from a site master page.
  • I don't have access to the master page.

On one content page I do have access to, I want to use a different version of JQuery for testing.

Is there a way to block the JQuery script from the master page so I can load up the version I want to use in the content page?

Thank you!

Carlos Mendieta
  • 860
  • 16
  • 41
  • 1
    you can run 2 different versions of jquery if you can't remove one of them, check out this post: https://stackoverflow.com/questions/1566595/can-i-use-multiple-versions-of-jquery-on-the-same-page – Sammy Sep 05 '18 at 15:44
  • I think you can do it. check out this post: https://stackoverflow.com/questions/18719082/how-to-replace-the-jquery-library-set-in-the-masterpage-from-a-content-page – samnu pel Sep 05 '18 at 15:46
  • 3
    you can use noConflict, but _really_ I can't stress how bad it is to try and supersede your own pages code. This seems to be coming up a lot lately where newer developers can't touch a `master` page, or api, or whatever. What you should do is reach out to the web master and have them adjust the code, or explain what you need to get your project off the ground. If they can't help you, explain the situation to your manager. Why is this so important? Consistency. Imagine you come in as a Developer and someone overwrote a master page, but you had no idea. Things are going to break in ugly ways. – zfrisch Sep 05 '18 at 15:47
  • 1
    Why would you test with anything other than the code that is going to be used - ie why use a different version in testing to what you do in production - surely that can just lead to problems where it works with the testing version but not with the production version – Pete Sep 05 '18 at 15:48
  • branch the application in source control, make a change to the master page there, test your changes in the branch. Are you literally physically unable to change the master page file? Or it's just a rule in your team? Whatever the process is, reach out to those who can make the change, explain why it's needed, and get them to create a feature branch (or make the necessary master page change in the branch, or review the change, or however you do things) so you can go ahead with your work. This is a process issue not a code issue IMO – ADyson Sep 05 '18 at 16:04
  • ...cont'd Pete is right, you don't want to test using some shoddy workaround only to find it doesn't work correctly when you come to merge it into the real version. If the whole source control thing doesn't apply or work for you, simply make a copy of the whole site on your disk and modify it there, and test using that to begin with. Once you can prove your changes will work, yo can ask for the main copy to be modified, and any necessary regression can be testing done to make sure it doesn't break any other pages. – ADyson Sep 05 '18 at 16:05

0 Answers0