Solved

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

Posted on 2014-03-17
5
167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn how to dynamically set the form action using jQuery.

730 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