Solved

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

Posted on 2014-03-17
5
163 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 your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
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…

746 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