为什么在与jquery一起使用时不能正常工作

时间:2015-05-13 08:44:22

标签: javascript jquery html5 symbols

我有一个问题我想将注册商标符号附加一个按钮,我想用jquery完成它,因为有很多很多按钮需要符号,当我用html例如(下面)它奏效了。

<input type="button" class="button_a" value="Value &reg;" />

但是当我使用如下的jquery时,它返回纯文本:

$('.button_a').each(function(){
    $(this).attr("value",$(this).attr("value")+" &reg;");
});

我不想浪费我的时间和空间,将&reg;放在所有按钮的值中,所以我希望它在jquery中完成,但我做错了什么。

我知道这是一个迟缓的问题,但请有人在这个问题上帮助我

也可以使用Javascript。

如需了解更多信息,请发表评论并询问

...谢谢

6 个答案:

答案 0 :(得分:6)

&reg;呈现为文本字符串,但您可以使用unicode \u00AE

$('.button_a').each(function(){
    this.value = this.value +" \u00AE";
});

http://jsfiddle.net/fbuohvm1/

或只是®

$('.button_a').each(function(){
    this.value = this.value +" ®";
});

http://jsfiddle.net/fbuohvm1/1/

答案 1 :(得分:5)

因为,虽然您正在操作的DOM是从HTML文档初始化的,但您现在正在处理DOM而不是HTML。您将值写为文本而不是HTML。

您需要使用文字字符("®")或JavaScript转义序列("\u00AE")。

答案 2 :(得分:1)

在设置文本框的值之前,您必须先DALVIK THREADS: (mutexes: tll=0 tsl=0 tscl=0 ghl=0) "main" prio=5 tid=1 NATIVE | group="main" sCount=1 dsCount=0 obj=0x419289a0 self=0x40090010 | sysTid=5597 nice=0 sched=0/0 cgrp=apps handle=1074811868 | state=S schedstat=( 22603587000 4850665501 38135 ) utm=1943 stm=317 core=1 #00 pc 0001770c /system/lib/libc.so (__ioctl+8) #01 pc 0002a70d /system/lib/libc.so (ioctl+16) #02 pc 00016ba1 /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+132) #03 pc 0001709d /system/lib/libbinder.so (android::IPCThreadState::waitForResponse(android::Parcel*, int*)+44) #04 pc 000172b7 /system/lib/libbinder.so (android::IPCThreadState::transact(int, unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+114) #05 pc 00014a3b /system/lib/libbinder.so (android::BpBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+34) #06 pc 0004a5a7 /system/lib/libmedia.so #07 pc 000486f7 /system/lib/libmedia.so (android::MediaPlayer::setDataSource(char const*, android::KeyedVector<android::String8, android::String8> const*)+102) #08 pc 00012235 /system/lib/libmedia_jni.so #09 pc 0001e290 /system/lib/libdvm.so (dvmPlatformInvoke+112) #10 pc 0004d411 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+396) #11 pc 000276a0 /system/lib/libdvm.so #12 pc 0002b57c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184) #13 pc 0005ff07 /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+374) #14 pc 000677e1 /system/lib/libdvm.so #15 pc 000276a0 /system/lib/libdvm.so #16 pc 0002b57c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184) #17 pc 0005fc31 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272) #18 pc 000499fb /system/lib/libdvm.so #19 pc 000468f9 /system/lib/libandroid_runtime.so #20 pc 000475bb /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*)+390) #21 pc 00000db7 /system/bin/app_process #22 pc 0001271f /system/lib/libc.so (__libc_init+38) #23 pc 00000ae8 /system/bin/app_process at android.media.MediaPlayer._setDataSource(Native Method) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:958) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:946) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:899) at android.webkit.HTML5VideoView.prepareDataCommon(HTML5VideoView.java:234) at android.webkit.HTML5VideoView.prepareDataAndDisplayMode(HTML5VideoView.java:271) at android.webkit.HTML5VideoInline.prepareDataAndDisplayMode(HTML5VideoInline.java:67) at android.webkit.HTML5VideoViewProxy$VideoPlayer.play(HTML5VideoViewProxy.java:247) at android.webkit.HTML5VideoViewProxy.handleMessage(HTML5VideoViewProxy.java:381) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) "Thread-377" prio=5 tid=16 TIMED_WAIT | group="main" sCount=1 dsCount=0 obj=0x434aa530 self=0x684613f0 | sysTid=6184 nice=0 sched=0/0 cgrp=apps handle=1740310048 | state=S schedstat=( 220125 144750 1 ) utm=0 stm=0 core=0 at java.lang.Object.wait(Native Method) - waiting on <0x434aa690> (a java.lang.VMThread) held by tid=16 (Thread-377) at java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:199) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1009) at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1302) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:248) at com.google.android.gms.ads.identifier.b.run(SourceFile:110) "Thread-367" prio=5 tid=27 NATIVE | group="main" sCount=1 dsCount=0 obj=0x424be9a0 self=0x6548b798 | sysTid=5861 nice=0 sched=0/0 cgrp=apps handle=1699697872 | state=S schedstat=( 614124000 155518500 1137 ) utm=30 stm=31 core=0 #00 pc 0001860c /system/lib/libc.so (epoll_wait+12) #01 pc 0012b949 /system/lib/libchromium_net.so #02 pc 0012b755 /system/lib/libchromium_net.so #03 pc 00058415 /system/lib/libchromium_net.so #04 pc 00056b13 /system/lib/libchromium_net.so (MessageLoop::RunInternal()+114) #05 pc 00056b71 /system/lib/libchromium_net.so (MessageLoop::Run()+16) #06 pc 000771d9 /system/lib/libchromium_net.so (base::Thread::ThreadMain()+188) #07 pc 00076c93 /system/lib/libchromium_net.so #08 pc 0000e3d8 /system/lib/libc.so (__thread_entry+72) #09 pc 0000dac4 /system/lib/libc.so (pthread_create+160) at dalvik.system.NativeStart.run(Native Method) "AdWorker #10" prio=5 tid=24 WAIT | group="main" sCount=1 dsCount=0 obj=0x42505360 self=0x65513d38 | sysTid=5856 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1693754872 | state=S schedstat=( 5158875 1391625 15 ) utm=0 stm=0 core=0 at java.lang.Object.wait(Native Method) - waiting on <0x42505490> (a java.lang.VMThread) held by tid=24 (AdWorker #10) at java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:159) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2019) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1013) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1073) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) "AsyncTask #1" prio=5 tid=26 WAIT | group="main" sCount=1 dsCount=0 obj=0x424fba78 self=0x64f9de20 | sysTid=5854 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1700056752 | state=S schedstat=( 5502000 4725750 5 ) utm=0 stm=0 core=3 at java.lang.Object.wait(Native Method) - waiting on <0x424d4488> (a java.lang.VMThread) held by tid=26 (AsyncTask #1) at java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:159) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2019) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1013) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1073) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) "CookieSyncManager" prio=5 tid=25 NATIVE | group="main" sCount=1 dsCount=0 obj=0x424ed4d8 self=0x64eb9010 | sysTid=5852 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1698324848 | state=S schedstat=( 760875 3061875 7 ) utm=0 stm=0 core=2 #00 pc 0001860c /system/lib/libc.so (epoll_wait+12) #01 pc 00014b09 /system/lib/libutils.so (android::Looper::pollInner(int)+96) #02 pc 00014d71 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+104) #03 pc 0005ee2b /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22) #04 pc 0001e290 /system/lib/libdvm.so (dvmPlatformInvoke+112) #05 pc 0004d411 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+396) #06 pc 000276a0 /system/lib/libdvm.so #07 pc 0002b57c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184) #08 pc 0005fc31 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272) #09 pc 0005fc5b /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20) #10 pc 000547d7 /system/lib/libdvm.so #11 pc 0000e3d8 /system/lib/libc.so (__thread_entry+72) #12 pc 0000dac4 /system/lib/libc.so (pthread_create+160) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:125) at android.os.Looper.loop(Looper.java:124) at android.webkit.WebSyncManager.run(WebSyncManager.java:90) at android.webkit.CookieSyncManager.run(CookieSyncManager.java:58) at java.lang.Thread.run(Thread.java:856) "WebViewCoreThread" prio=5 tid=23 WAIT | group="main" sCount=1 dsCount=0 obj=0x424dfe28 self=0x65282618 | sysTid=5850 nice=0 sched=0/0 cgrp=apps handle=1693304448 | state=S schedstat=( 96815166381 6945372375 34587 ) utm=9350 stm=331 core=2 at java.lang.Object.wait(Native Method) - waiting on <0x43412b38> (a android.webkit.CallbackProxy) at java.lang.Object.wait(Object.java:364) at android.webkit.CallbackProxy.sendMessageToUiThreadSync(CallbackProxy.java:1612) at android.webkit.CallbackProxy.shouldOverrideUrlLoading(CallbackProxy.java:1035) at android.webkit.BrowserFrame.handleUrl(BrowserFrame.java:635) at android.webkit.JWebCoreJavaBridge.sharedTimerFired(Native Method) at android.webkit.JWebCoreJavaBridge.fireSharedTimer(JWebCoreJavaBridge.java:92) at android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:108) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:812) at java.lang.Thread.run(Thread.java:856) "AdWorker #9" prio=5 tid=22 WAIT | group="main" sCount=1 dsCount=0 obj=0x425961c0 self=0x64ed7d90 | sysTid=5837 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1688329088 | state=S schedstat=( 17043000 22746750 69 ) utm=1 stm=0 core=0 at java.lang.Object.wait(Native Method) - waiting on <0x425962f0> (a java.lang.VMThread) held by tid=22 (AdWorker #9) at java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:159) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2019) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1013) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1073) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) "AdWorker #8" prio=5 tid=21 WAIT | group="main" sCount=1 dsCount=0 obj=0x423bd030 self=0x652cf248 | sysTid=5836 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1698325648 | state=S schedstat=( 31946625 39978000 119 ) utm=3 stm=0 core=1 at java.lang.Object.wait(Native Method) - waiting on <0x4238f148> (a java.lang.VMThread) held by tid=21 (AdWorker #8) at java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:159) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2019) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1013) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1073) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) "AdWorker #7" prio=5 tid=20 WAIT | group="main" sCount=1 dsCount=0 obj=0x4257fbe8 self=0x65cbac58 | sysTid=5832 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1707861064 | state=S schedstat=( 24793875 28706250 108 ) utm=2 stm=0 core=0 at java.lang.Object.wait(Native Method) - waiting on <0x4259cda8> (a java.lang.VMThread) held by tid=20 (AdWorker #7) at java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:159) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2019) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1013) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1073) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) "AdWorker #6" prio=5 tid=19 WAIT | group="main" sCount=1 dsCount=0 obj=0x42590de0 self=0x65cba808 | sysTid=5830 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1707859064 | state=S schedstat=( 16917000 23230125 83 ) utm=0 stm=1 core=1 at java.lang.Object.wait(Native Method) - waiting on <0x42576bb0> (a java.lang.VMThread) held by tid=19 (AdWorker #6) at java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:159) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2019) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1013) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1073) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) "AdWorker #5" prio=5 tid=18 WAIT | group="main" sCount=1 dsCount=0 obj=0x4250d2f0 self=0x65cba3b8 | sysTid=5829 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1707858848 | state=S schedstat=( 10773375 9319125 62 ) utm=1 stm=0 core=2 at java.lang.Object.wait(Native Method) - waiting on <0x425195a0> (a java.lang.VMThread) held by tid=18 (AdWorker #5) at java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:159) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2019) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1013) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1073) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) "AdWorker #4" prio=5 tid=17 WAIT | group="main" sCount=1 dsCount=0 obj=0x425093d8 self=0x65cb1a58 | sysTid=5826 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1750441672 | state=S schedstat=( 40946625 32669250 142 ) utm=4 stm=0 core=2 at java.lang.Object.wait(Native Method) - waiting on <0x424f5bc8> (a java.lang.VMThread) held by tid=17 (AdWorker #4) at java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:159) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2019) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1013) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1073) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) "AdWorker #3" prio=5 tid=15 WAIT | group="main" sCount=1 dsCount=0 obj=0x429ac658 self=0x6521bb48 | sysTid=5814 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1755337696 | state=S schedstat=( 14493750 10239000 56 ) utm=0 stm=1 core=1 at java.lang.Object.wait(Native Method) - waiting on <0x429ac788> (a java.lang.VMThread) held by tid=15 (AdWorker #3) at java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:159) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2019) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1013) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1073) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) "AdWorker #2" prio=5 tid=14 WAIT | group="main" sCount=1 dsCount=0 obj=0x424f29b8 self=0x65195788 | sysTid=5772 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1696160728 | state=S schedstat=( 187430250 69782625 291 ) utm=16 stm=2 core=0 at java.lang.Object.wait(Native Method) - waiting on <0x424f2ae8> (a java.lang.VMThread) held by tid=14 (AdWorker #2) at java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:159) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2019) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1013) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1073) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) "Gservices" prio=5 tid=13 NATIVE | group="main" sCount=1 dsCount=0 obj=0x424e3a80 self=0x64edc740 | sysTid=5771 nice=0 sched=0/0 cgrp=apps handle=1698842416 | state=S schedstat=( 1592625 1721625 6 ) utm=0 stm=0 core=1 #00 pc 0001860c /system/lib/libc.so (epoll_wait+12) #01 pc 00014b09 /system/lib/libutils.so (android::Looper::pollInner(int)+96) #02 pc 00014d71 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+104) #03 pc 0005ee2b /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22) #04 pc 0001e290 /system/lib/libdvm.so (dvmPlatformInvoke+112) #05 pc 0004d411 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+396) #06 pc 000276a0 /system/lib/libdvm.so #07 pc 0002b57c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184) #08 pc 0005fc31 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272) #09 pc 0005fc5b /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20) #10 pc 000547d7 /system/lib/libdvm.so #11 pc 0000e3d8 /system/lib/libc.so (__thread_entry+72) #12 pc 0000dac4 /system/lib/libc.so (pthread_create+160) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:125) at android.os.Looper.loop(Looper.java:124) at com.google.android.gsf.g.run(SourceFile:85) "Binder_4" prio=5 tid=12 NATIVE | group="main" sCount=1 dsCount=0 obj=0x424e2ed0 self=0x64a1b3f0 | sysTid=5770 nice=0 sched=0/0 cgrp=apps handle=1698841824 | state=S schedstat=( 20267625 11236125 111 ) utm=2 stm=0 core=0 #00 pc 0001770c /system/lib/libc.so (__ioctl+8) #01 pc 0002a70d /system/lib/libc.so (ioctl+16) #02 pc 00016ba1 /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+132) #03 pc 00017363 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+154) #04 pc 0001b15d /system/lib/libbinder.so #05 pc 00011267 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+114) #06 pc 00046827 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+66) #07 pc 00010dcd /system/lib/libutils.so #08 pc 0000e3d8 /system/lib/libc.so (__thread_entry+72) #09 pc 0000dac4 /system/lib/libc.so (pthread_create+160) at dalvik.system.NativeStart.run(Native Method) "AdWorker #1" prio=5 tid=11 WAIT | group="main" sCount=1 dsCount=0 obj=0x423b1128 self=0x68a93050 | sysTid=5767 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1688345192 | state=S schedstat=( 62938125 37317000 165 ) utm=4 stm=2 core=1 at java.lang.Object.wait(Native Method) - waiting on <0x423b12c8> (a java.lang.VMThread) held by tid=11 (AdWorker #1) at java.lang.Thread.parkFor(Thread.java:1231) at sun.misc.Unsafe.park(Unsafe.java:323) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:159) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2019) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1013) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1073) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) "Binder_3" prio=5 tid=10 NATIVE | group="main" sCount=1 dsCount=0 obj=0x423bb490 self=0x650da208 | sysTid=5750 nice=0 sched=0/0 cgrp=apps handle=1073913672 | state=S schedstat=( 21292125 11917500 115 ) utm=1 stm=1 core=1 #00 pc 0001770c /system/lib/libc.so (__ioctl+8) #01 pc 0002a70d /system/lib/libc.so (ioctl+16) #02 pc 00016ba1 /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+132) #03 pc 00017363 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+154) #04 pc 0001b15d /system/lib/libbinder.so #05 pc 00011267 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+114) #06 pc 00046827 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+66) #07 pc 00010dcd /system/lib/libutils.so #08 pc 0000e3d8 /system/lib/libc.so (__thread_entry+72) #09 pc 0000dac4 /system/lib/libc.so (pthread_create+160) at dalvik.system.NativeStart.run(Native Method) "Binder_2" prio=5 tid=9 NATIVE | group="main" sCount=1 dsCount=0 obj=0x41d20258 self=0x64e6b008 | sysTid=5608 nice=0 sched=0/0 cgrp=apps handle=1745234816 | state=S schedstat=( 24972000 17994375 149 ) utm=1 stm=1 core=1 #00 pc 0001770c /system/lib/libc.so (__ioctl+8) #01 pc 0002a70d /system/lib/libc.so (ioctl+16) #02 pc 00016ba1 /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+132) #03 pc 00017363 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+154) #04 pc 0001b15d /system/lib/libbinder.so #05 pc 00011267 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+114) #06 pc 00046827 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+66) #07 pc 00010dcd /system/lib/libutils.so #08 pc 0000e3d8 /system/lib/libc.so (__thread_entry+72) #09 pc 0000dac4 /system/lib/libc.so (pthread_create+160) at dalvik.system.NativeStart.run(Native Method) "Binder_1" prio=5 tid=8 NATIVE | group="main" sCount=1 dsCount=0 obj=0x41d1ffe0 self=0x6831cfe8 | sysTid=5607 nice=0 sched=0/0 cgrp=apps handle=1752326840 | state=S schedstat=( 29002125 17950500 143 ) utm=1 stm=1 core=3 #00 pc 0001770c /system/lib/libc.so (__ioctl+8) #01 pc 0002a70d /system/lib/libc.so (ioctl+16) #02 pc 00016ba1 /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+132) #03 pc 00017363 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+154) #04 pc 0001b15d /system/lib/libbinder.so #05 pc 00011267 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+114) #06 pc 00046827 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+66) #07 pc 00010dcd /system/lib/libutils.so #08 pc 0000e3d8 /system/lib/libc.so (__thread_entry+72) #09 pc 0000dac4 /system/lib/libc.so (pthread_create+160) at dalvik.system.NativeStart.run(Native Method) "FinalizerWatchdogDaemon" daemon prio=5 tid=7 WAIT | group="system" sCount=1 dsCount=0 obj=0x41d1ced8 self=0x64e3b008 | sysTid=5606 nice=0 sched=0/0 cgrp=apps handle=1757905496 | state=S schedstat=( 765375 6303375 9 ) utm=0 stm=0 core=2 at java.lang.Object.wait(Native Method) - waiting on <0x419324d8> (a java.lang.Daemons$FinalizerWatchdogDaemon) at java.lang.Object.wait(Object.java:364) at java.lang.Daemons$FinalizerWatchdogDaemon.waitForObject(Daemons.java:230) at java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:207) at java.lang.Thread.run(Thread.java:856) "FinalizerDaemon" daemon prio=5 tid=6 WAIT | group="system" sCount=1 dsCount=0 obj=0x41d1cd80 self=0x64e3bb58 | sysTid=5605 nice=0 sched=0/0 cgrp=apps handle=1750985800 | state=S schedstat=( 54320625 20621250 101 ) utm=5 stm=0 core=0 at java.lang.Object.wait(Native Method) - waiting on <0x4191e610> (a java.lang.ref.ReferenceQueue) at java.lang.Object.wait(Object.java:401) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73) at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:170) at java.lang.Thread.run(Thread.java:856) "ReferenceQueueDaemon" daemon prio=5 tid=5 WAIT | group="system" sCount=1 dsCount=0 obj=0x41d1cc18 self=0x6536b008 | sysTid=5604 nice=0 sched=0/0 cgrp=apps handle=1759842776 | state=S schedstat=( 4781625 908250 51 ) utm=0 stm=0 core=1 at java.lang.Object.wait(Native Method) - waiting on <0x4191e538> at java.lang.Object.wait(Object.java:364) at java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:130) at java.lang.Thread.run(Thread.java:856)

encode

$('.button_a').each(function () { $(this).val("value " + $("<div/>").html('&reg;').text()); }); 将返回编码值。

演示:here

答案 3 :(得分:0)

您需要按BIO* bioRaw; std::unique_ptr<BIO, decltype(&BIO_free)> bio(bioRaw, BIO_free); 处理内容,因为html实体由html()函数操作,请尝试此代码。

html()

答案 4 :(得分:0)

使用隐藏的div

$('.button_a').each(function(){
    var decoded = $('<div/>').html('&reg;').text();
    $(this).val($(this).val() + ' ' + decoded);
});

参见 Sample

答案 5 :(得分:0)

在你的情况下,普通的js更直接:

$('.button_a').each(function(){
    this.value += " &reg;";
});

- 编辑 - 不幸的是,这仍然是逃脱的,实际上你需要

    this.value += " \u00AE";