The Syndk8 - Black Hat SEO Paradise
Fantomaster - Industrial Strength Black Hat SEO Tools
Affiliate Earners: Affiliate Programs
Home
Help
Search
Login
Register
RSS for SEOIdiot
Welcome,
Guest
. Please
login
or
register
.
February 11, 2012, 11:25:19 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home (Index)
Level 1 Cache: General Discussion
NEW BOARD: The n00b Zone
jquery qq
Pages: [
1
]
« previous
next »
Print
Author
Topic: jquery qq (Read 624 times)
Phaėton
Lifer
Offline
Posts: 503
⎝⏠⏝⏠⎠
jquery qq
«
on:
June 23, 2010, 11:20:55 PM »
When I do the alert($("p").html());
i get 'this is a paragraph' in the alert box <p>
How do i reference the second <p>, or all <p>'s as
an array without assigning the <p id> or <p class>?
assuming there are just two vanilla <p>'s
Code:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
alert($("p").html());
});
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button">Click me</button>
</body>
</html>
«
Last Edit: June 23, 2010, 11:32:15 PM by Phaėton
»
Logged
When I was your age we used to walk to the TV to change the channel.... _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
perkiset
Olde World Hacker
Administrator
Lifer
Online
Posts: 9792
Re: jquery qq
«
Reply #1 on:
June 23, 2010, 11:32:36 PM »
In that instance, it's only going to return/use the first p found in the bound set because the alert function is not equipped to understand it.
Although there is a much tighter way of doing this with jQuery (hint, look up iterators and a sort of foreach thang
) the most immediately easy to understand is:
Code:
var pSet = $('p');
var max = pSet.length;
for (var i=0; i<max; i++)
alert(pSet[i].html());
... although it's late and I'm pretty certain I've done that wrong
Logged
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Phaėton
Lifer
Offline
Posts: 503
⎝⏠⏝⏠⎠
Re: jquery qq
«
Reply #2 on:
June 23, 2010, 11:39:30 PM »
awesome... thanks...
its later for me!!! wake up, america!
do google spiders execute java code or
could you put stuff in a div like this for
the spider:
<p>penis pills, sex scandal, oil spill, viagra</p>
and then load some .js from a server somewhere like:
<script type="text/javascript" src="switcharoo.js"></script>
that had a function in it to replace it with your
latest scam like:
$(selector).append(secretcontentooglegaywillneverknow)
Logged
When I was your age we used to walk to the TV to change the channel.... _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
perkiset
Olde World Hacker
Administrator
Lifer
Online
Posts: 9792
Re: jquery qq
«
Reply #3 on:
June 23, 2010, 11:46:18 PM »
Yes they can execute code, however the consistency and impact of that has never been clearly proven. They *absolutely* do some things with code, however some have postulated that they only look for certain things and infer from the code, rather than actually run it (which would be rather smart and keep their spiders out of crappy code loops).
What you're talking about is client side cloaking. It can be done, but real care must be taken. I do some of this still today, but I am *extremely* careful and also very good at it. There are some techniques that the clever person would say, "c'mon man, that's a straight up cloak" but I can argue plausible deniability and strong reason for the mechanics in the code. In fact, a Google analyzer might look at my code and think it was the height of contemporary multi-browser, multi-modality HTML. F'reals
Logged
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Phaėton
Lifer
Offline
Posts: 503
⎝⏠⏝⏠⎠
Re: jquery qq
«
Reply #4 on:
June 23, 2010, 11:53:01 PM »
ahh... just googled it,
i see... mr wikipedia..
Logged
When I was your age we used to walk to the TV to change the channel.... _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
kurdt
Lifer
Offline
Posts: 1153
paha arkkitehti
Re: jquery qq
«
Reply #5 on:
June 23, 2010, 11:55:56 PM »
Perk is right about Google analyzing javascript. I remember reading many years back that Google either patented or somebody from Google said publicly that they have some sort of technology that renders the page. They didn't specify much but it's very likely that they are rendering pages in some cases. It could be useful in detecting content and navigation areas. Also if they render pages, they might be able to detect client-side cloaking just by detecting weird shit going on compared to what their code analyzer thinks. Of course you won't get penalized until manual review is done but you probably won't be enjoying top rankings until manual review is done.
Logged
I met god and he had nothing to say to me.
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Level 1 Cache: General Discussion
-----------------------------
=> Init() - New Member Introductions
=> NEW BOARD: The n00b Zone
=> Callback Routines
=> Recovered Sectors
=> freemem() & Garbage Collection
=> All Things General Tech
=> All Things Android
=> All Things Apple
=> All Things Database
=> All Things Microsoft
=> All Things *nix
-----------------------------
Level 2 Cache: Speciality Items
-----------------------------
=> AJAX
=> ASP & .NET
=> C/++/#/Objective, Java, ObjectPascal
=> CSS, HTML & SEO, Cloaking
=> JavaScript
=> Music Technology
=> PERL
=> PHP
=> Obscurites, Curiosities & Arcanity
=> Regex
-----------------------------
Frameworks, Applications & Projects
-----------------------------
=> phpMyIDE
=> The iPhone SMF Theme Project
=> SMF
-----------------------------
Retired Boards
-----------------------------
=> ColdFusion
=> phpMyIDE
=> SalesForce / Apex
=> Javascript Code Repository & Examples
=> PHP Code Repository / Examples
Perkiset's Place Home
Best of The Cache
phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's
Pinkhat's Perspective
cache
mart
coder
programmers
ajax
php
javascript
Loading...