?
Solved

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

Posted on 2014-03-17
5
Medium Priority
?
172 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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses
Course of the Month14 days, 12 hours left to enroll

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