ThIs SiTe Is A TyPo AnD A BuG.
[php]phpからdocument.writeでjavascript出したりするときに便利なやつ
ソーシャルブックマークに追加:
Category :
php
参照元:http://feedtailor.jp/oishi/2007/05/javascriptdocumentwritephptext.html
ありがたく使わせて頂きます。
いつもdocument.writeでわざわざくくってましたが。
---------------------------------------------------------------------------------------------------------------------
function js_write($a)
{
$lines = split("\n", $a);
if(!empty($lines)){
foreach($lines as $i => $line){
$line = str_replace("'", "\'" , $line);
$lines[$i] = preg_replace("|^(.*)$|", '\'$1\n\'+', $line);
}
}
$a = join("\n", $lines);
$a = substr($a, 0, strlen($a)-1);
return 'document.write('.$str.');';
}
-------------------------------------------------------------------------------------------------
とりあえず↓
function jsAction(){
echo $this->_js_document_write("<script type='text/javascript'>alert('aaaaa');</script>");
}
な感じで、うまく動いた。
ありがたく使わせて頂きます。
いつもdocument.writeでわざわざくくってましたが。
---------------------------------------------------------------------------------------------------------------------
function js_write($a)
{
$lines = split("\n", $a);
if(!empty($lines)){
foreach($lines as $i => $line){
$line = str_replace("'", "\'" , $line);
$lines[$i] = preg_replace("|^(.*)$|", '\'$1\n\'+', $line);
}
}
$a = join("\n", $lines);
$a = substr($a, 0, strlen($a)-1);
return 'document.write('.$str.');';
}
-------------------------------------------------------------------------------------------------
とりあえず↓
function jsAction(){
echo $this->_js_document_write("<script type='text/javascript'>alert('aaaaa');</script>");
}
な感じで、うまく動いた。
PR
この記事にコメントする
Locksmith Virginia Beach
Patriotism means to stand by the country. It does not mean to stand by the president or any other public official...
Dr simeons hcg diet
My neighbour asked if he could use my lawnmower and I told him of course he could, so long as he didn't take it out of my garden.
Locksmith Tucson
If you're sick and tired of the politics of cynicism and polls and principles, come and join this campaign.
incorporation
When his life was ruined, his family killed, his farm destroyed, Job knelt down on the ground and yelled up to the heavens, 'Why god? Why me?' and the thundering voice of God answered, 'There's just something about you that pisses me off.'
Locksmith Orlando FL
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25 !
Locksmith Hartford
The chain reaction of evil -- wars producing more wars -- must be broken, or we shall be plunged into the dark abyss of annihilation.
Locksmith Philadelphia PA
Ever notice when you blow in a dog's face he gets mad at you, but when you take him in a car he sticks his head out the window?
Locksmiths Tucson
The significant problems we face cannot be solved at the same level of thinking we were at when we created them.
Locksmiths Oakland CA
A sense of humor is part of the art of leadership, of getting along with people, of getting things done.
Locksmith Los Angeles
Ketchup left overnight on dinner plates has a longer half-life than radioactive waste.
What happens if i take clomid while pregnant
... one of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.
Info on propecia
I don't know why we are here, but I'm pretty sure that it is not in order to enjoy ourselves.
Effect of propecia
Of all the enemies to public liberty, war is perhaps the most to be dreaded because it comprises and develops the germ of every other.
Propecia
The instinct of nearly all societies is to lock up anybody who is truly free. First, society begins by trying to beat you up. If this fails, they try to poison you. If this fails too, the finish by loading honors on your head.
Created by awstats plugins online pharmacy tramadol
There's many a bestseller that could have been prevented by a good teacher.
Wellbutrin sr side effects
A lie gets halfway around the world before the truth has a chance to get its pants on.
HCG Drops
Analyzing humor is like dissecting a frog. Few people are interested and the frog dies of it.
Suhagra recall
If people can judge me on the company I keep, they would judge me with keeping really good company with Laura.
Interaction of azor and potassium znd lasix
You can only find truth with logic if you have already found truth without it.
Adipex
My advice to you is get married: if you find a good wife you'll be happy; if not, you'll become a philosopher.
Tizanidine effect on renal function
Why was I with her? She reminds me of you. In fact, she reminds me more of you than you do!
Differin acne
I've never seen anyone change his mind because of the power of a superior argument or the acquisition of new facts. But I've seen plenty of people change behavior to avoid being mocked.
Buy Ambien
'Everything you say is boring and incomprehensible', she said, 'but that alone doesn't make it true.'
Cialis professional fake
The man who goes alone can start today; but he who travels with another must wait till that other is ready.
Is oxycodone the same as oxycontin
The company doesn't tell me what to say, and I don't tell themwhere to stick it.
Priligy dapoxetine
If there is no Hell, a good many preachers are obtaining money under false pretences.
Buy Ambien
Maybe there is no actual place called hell. Maybe hell is just having to listen to our grandparents breathe through their noses when they're eating sandwiches.
Buy Levitra
Politics is the art of looking for trouble, finding it everywhere, diagnosing it incorrectly, and applying the wrong remedies.
Cheap Parliament Cigarettes
The significant problems we face cannot be solved at the same level of thinking we were at when we created them.
Differin
What a cruel thing is war: to separate and destroy families and friends, and mar the purest joys and happiness God has granted us in this world; to fill our hearts with hatred instead of love for our neighbors, and to devastate the fair face of this beautiful world.
What to try after differin
Barabási's Law of Programming: Program development ends when the program does what you expect it to do whether it is correct or not.
Vigrx warning
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Generic ambien without a prescription
All rights left. All lefts reserved. All reserves removed. All removes right.
Lunesta symptoms
So I rang up a local building firm, I said 'I want a skip outside my house.' He said 'I'm not stopping you.'
公開中のサービス
MAの輪
ブログ内検索
ログール
アクセス解析
このページのQRコード