Solved

How to select to display a dialog only when it's at a certain site/page title?

Posted on 2014-03-17
5
166 Views
Last Modified: 2014-03-17
Currently it selects the link tag with a long class name to display a dialog.  How can I modify the selector so it will only select to display when it's at a page with a certain Title field in the header section?  Is that possible?

Thank you
index7.html
0
Comment
Question by:lapucca
  • 3
  • 2
5 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39934856
if(document.title=="Page Title"){
     $("a.ms-comm-metalineItemSeparator.ms-blog-command-noLeftPadding.ms-textSmall").click(function(e) {
...
     })
}

Open in new window

0
 

Author Comment

by:lapucca
ID: 39934865
Any way to trim the leading and trailing blanks before equal sign or contain operator?
0
 

Author Comment

by:lapucca
ID: 39934871
if (document.title.indexof("title") !=-1) {

Will this work?
0
 
LVL 58

Expert Comment

by:Gary
ID: 39934885
Not sure what you mean

To trim the title

if(document.title.trim()=="Page Title"){

You can do
if (document.title.indexOf("title") !=-1) {
0
 

Author Comment

by:lapucca
ID: 39934963
This doesn't work because my dialog doesn't get displayed, if (document.title.indexOf("title") !=-1) {

I'll work with the other one, thank you.
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
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)

839 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