Solved

Javascript/Jquery SharePoint

Posted on 2011-09-27
3
182 Views
Last Modified: 2012-05-12
Hello all,

I have a code that searches a page and then highlights the information that is found. I would like to create a code that if it is not on page A then it should stop and search page B. If it is not on both pages then it will return nothing. Below is the code that I have that searches a page.

$("body").delegate("#inoiceNumber_a", "click", function(e){
      JumpAndSearch("#inoiceNumber", "si_", "#divSearchErrorMsg", SPSITENAME + "invoiceInformation.aspx");
});


Now if I can only let it search two pages if it doesn't get it in the first page.

Thanks in advance.
0
Comment
Question by:Isaac
  • 2
3 Comments
 
LVL 1

Expert Comment

by:danbaugher
ID: 36711471
You can't access more than 1 page at a time in jQuery. You would need to code this on the backend or load the second page inside of the first page with ajax.
0
 
LVL 5

Author Comment

by:Isaac
ID: 36711660
Oh ok. Well can jQuery do a window pop for the second page. If so I can it be done?
0
 
LVL 1

Accepted Solution

by:
danbaugher earned 500 total points
ID: 36712119
Yes you could load the second window in a popup or lightbox and do your highlighting from there. You could pass the information to be highlighted after a hash tag, then have your ready function check for the existence of that hash tag and highlight content.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Jquery datatables integration with ASP.NET MVC, bootstrap 3 22
Html Table looping 4 26
jQuery Toggle & Anchor Links 5 43
Start Auto-download of File when page loads? 1 23
There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question