Solved

Javascript/Jquery SharePoint

Posted on 2011-09-27
3
180 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

930 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now