Solved

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

Posted on 2014-03-17
5
165 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Change color of pagination for twbs-pagination 3 27
Converting dates in JavaScript 2 36
Add box and text color changing for everything 1 26
Jquery 10 20
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…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

832 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