I am migrating a site from SP2010 to SP2013. The old site is not built by me so I am not familiar with the old design.

After migrated to SP2013 (run in SP2013 mode already) In one of the page contain a custom webpart. The page return Javascript error "abc.js Line 1 char 1 object expected". The JS file abc.js is existing. In order to trackle the JS error I need to find out how the file is included during rendering.

When I "view source" the page some JS files (include abc.js) are include. When I edit the page, there is a Content Editor webpart named "JS". When I look into it it is blank. The JS files are not included in Master page, too.

I have open the source code with VS2010. By search keyword "abc.js" for entire solution there is nothing.

What could be the trick? Sorry I am not a developer.

1 Answer 1

  1. Open Firefox

  2. Open the site in question

  3. Open firebug plugin

  4. Look for abc.js in the html markup

  5. If it's not there, enable the script tab

  6. Refresh the page

  7. Search for abc.js within the script tab

The file may be added by the master page, by a page layout, by the page itself, a CEWP or another script

Also, when you open the CEWP, make sure you edit in the html view, or you will see blank but maybe something is there

  • In the content editor webpart, I only see a "content link" to let me add a link content. I don't see any html view. Am I miss understand?
    – Mark L
    Jun 12, 2014 at 9:00
  • the webpart can render the contents of a file from a link (in edit webpart) or it can store content inside the webpart itself. if you click the content area of the webpart you should be able to see an "edit html" button in the ribbon. sp2010 link: nothingbutsharepoint.com/sites/eusp/pages/… Jun 12, 2014 at 9:07
  • By viewsource or firebug I see the line: <script src="/_layouts/ABC/develop/scripts/news.js" type="text/javascript"> But I don't know the source of this line. The site is not developed by me
    – Mark L
    Jun 13, 2014 at 1:40
  • It means that your news.js file is located in the SharePoint Server filesystem, more specifically in: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ABC\develop\news.js. the call itself I cant say without seeing the source, but appears to be in the page, possibly in that CEWP. Jun 13, 2014 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.