unidentified javascript function [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I've been handed a role administering a SharePoint site, and the following custom code is on one of the pages:
<script type="text/javascript">
$(document).ready(function() {
$("#pgtitle").html("Customer Service Feedback");
});
</script
I'm not a javascript guy, so I'm having trouble interpreting this. The code was written by someone who is no longer with my firm, and left well before I arrived.

$(document).ready(function() means that the code that follows, will start as soon as the page has loaded.
$("#pgtitle").html("Customer Service Feedback"); simply passes the value Customer Service Feedback to the HTML element pgtitle.
if you look on the page for the pgtitle element, I'm sure you will see it contains the text Customer Service Feedback ! :)

It sets text on the element of id = pgtitle as soon as the DOM document had fully loaded. In human language it manually sets the value of some title.

Have a look at the JQuery library for the "html" method and if you look for the id that is called "pgtitle" you will find the html that is effected.
Source:http://api.jquery.com/html/

Related

form is not working, I used HTML5 & bootstrap 3.0? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
form is not working, I used HTML5 & bootstrap 3.0?
here i add the link of the site please checkout.
I cant figure-out it.
http://www.deliveryguys.in/html/index.html
It's usually best to post snippits of code that you think are malfunctioning but in this case I think you should invest in a spellchecker.
I went to
http://www.deliveryguys.in/html/index.html
And it seems to work fine.
Notice it's HTML instead of HMTL
Edit: OK now I see the real problem with your code
The form is underneath other HTML elements. You need to give your stylings z-indexes in order to control what is on top of what. I gave the form a z-index of 1000 and it worked fine. I suggest editing your css classes to include z-indexes to give you finer control than that.
Please note that your form action has been mapped to "#"
Kindly point the form action to the appropriate server page & it will start working.
Regards
SRIRAM NATARAJAN
(Chennai, Tamil Nadu, India)
(www.thesriram.co.in)

Comodo TrustLogo Wiping Out JS based pages [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
So I'm guessing this happens with.. many.. somewhat old-tech things like this, but I have a javascript only website based on backbone, and have shopping pages I'd like to get some validated badges on, case in point: [A Comodo Trustlogo][1]
Basically, when I follow the instructions, it completely wipes out the page, replacing the entire body with a white page and the logo itself, instead of kindly inserting itself into a div or whatnot.
Anyone have an idea on how to get it to inline properly?
This is to do with where you have placed your Comodo code. Where you've placed it, both document.write and document.writeln will destroy the page.
Move it to the top of the <body> element or whereever in the <body> element (not outside, not in <head>, not directly in <html> nor on the outside) you prefer.

Make all instances of part of word italic [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm using expressionengine as a CMS, after the page is loaded, I need to find 'arbesthealth' and make it ar*best*health, What would be the best way to do this? Jquery after document ready? can it be done with CSS?
note: I can't do it on the cms side because EE doesn't allow tags inside the title fields so it needs to be done on output. I guess I could do it with a substr in php, but I'm just curious to the other ways that this would be possible.
The simple solution would be to manipulate innerHTML (directly, or through jQuery's html function), but that will destroy and recreate all of the elements, which isn't ideal — not least because any event handlers attached to them will get removed.
But a simple recursive function processing text nodes and inserting strong elements as necessary isn't difficult. My answer to this other SO question shows how to do that, walking through the text nodes and using Text#splitText to split them up and insert elements. Sounds like a lot more work than it is.
Wrap a tag inside the word like this:
$('.content').wrapInTag({
words: ['best'],
tag: '<span>'
});
See FIDDLE
I added in .content but you can add it wherever the cms has the container
*UPDATE*
As mentioned this will effect all so lets try this method:
html().replace
SPECIFIC FIDDLE

Who/what calls CSS? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
In his video tutorail
http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-day-1/
the author goes to the Codegnitor web site. At first (1:32) the site looks strange (like it did not have any CSS behind it), but when he refreshes it once more the site looks like it should (1:37).
Does anyone know what is the mechanism behind it? I guess that JavaScript calls CSS. Can anyone give me some more details/examples.
Namely I would like to have my site working just like that.
CSS gets activated by 2 possible methods.
Invocation by DOM when the html file is parsed.
Invocation of CSS forcefully by JavaScript's functions.
On this video second method has been used.

Edit external CSS/SCSS with javascript [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need to 'edit' a file that's already saved on my server, example:
<link rel="stylesheet" href="css/plugin.scss">
But not only that, I want to edit a certain specific line, in SASS you can define variables in css, basically, I'd like to search inside this file with JAVASCRIPT for the string:
'$increment:
And if it's found, find out what line it is on and replace that whole line with:
'$increment:10;
Basically I want to generate a downloadable file for the user that's custom depending on what settings they choose via a html input field.
If there's a simpler/better explanation I'm all ears :)
The javascript you seem to be referring to (jQuery) is a client-side language so you're not going to be able to do anything on your server with it. A js solution that could do this may be written in nodejs but you may be better served using something like Python, Rails, or even PHP.

Categories