在JQuery中连接两个字符串(concat two strings in JQuery)
就像上面的标题:如何在JQuery中连接两个字符串?
这是我迄今为止的代码:
$(document).ready(function(){ serviceName = '<?=$_GET['services'] . ".php";?>'; serviceID='<?= "#" .$_GET['services'];?>'; serviceClass = '<?=$_GET['services'];?>'; if (serviceName != "") { alert(serviceID); $('.main_content').load(serviceName); $(serviceID).addClass("it"); } });
正如你在上面的代码中看到的那样,在变量名
serviceID
,我将hashtag
和我的GET
值连接起来,并且试图将它放在ALERT上,并且结果是正确的,但是当我将它分配给.addClass
它不起作用。任何替代品和解决方案,非常感谢。
Just like the title above: how to concatenate two strings in JQuery?
This is my code so far:
$(document).ready(function(){ serviceName = '<?=$_GET['services'] . ".php";?>'; serviceID='<?= "#" .$_GET['services'];?>'; serviceClass = '<?=$_GET['services'];?>'; if (serviceName != "") { alert(serviceID); $('.main_content').load(serviceName); $(serviceID).addClass("it"); } });
As you can see in my above code, in variable name
serviceID
, I am concatenatinghashtag
and myGET
value and I try to put it on ALERT and the result is correct, but when I assign it to.addClass
it’s not working.Any alternatives and solution is much appreciated.
原文:https://stackoverflow.com/questions/23361027
最满意答案
可能,您获得的错误是由于单独的头文件定义,最重要的是x86架构的不同共享库文件和PowerPC体系结构的不同头文件。 您可以使用“-I”标志更改头文件定义,使用PowerPC体系结构的共享库文件路径更改头文件定义,可以使用-L选项进行更改。 但是这些所有更改都可能在Makefile中实现,所以你只需要改变不同标志中的位置,比如LDFLAG,CFLAGS等。
Probably, the error you are getting is due to the separate header file definition and most importantly different shared library files for x86 architecture and different header files for PowerPC architecture. You can change the header file definitions with the new ones using "-I" flag and the shared library file path which is for PowerPC architecture, which can be changed by using -L option. But these all changes might be implemented in Makefile, so u just need to change the location in different flags, like LDFLAG, CFLAGS etc.
相关问答
更多-
instanceof GroovyObject ? 我创建了以下Java类: import groovy.lang.GroovyObject; public class A { public static void main(String[] args) { B b = new B(); if (b instanceof GroovyObject) { System.out.println("b is a groovyobject"); b.yeah(); ...
-
什么是tty子系统?(What is the tty subsystem for?)[2023-11-08]
澄清(可能会回答你的一些问题):我认为你的意思是pty(而不是ptty)是伪tty /伪终端。 tty(/ dev / ttyx) - 代表电传打字机 - 是原始终端(用于输出的行式打印机和用于输入的键盘!)。 终端基本上只是一个使用文本输入和输出的用户界面设备。 pty(/ dev / pty / n)是一个伪终端 - 它是一个软件实现,对于附加程序看起来像终端,但不是直接与“真实”终端通信,而是将输入和输出传输到另一个程序。 它是telnet / SSH甚至GNOME终端的终点。 例如,当您进入远程计算 ... -
Beaglebone交叉汇编(Beaglebone cross compilation)[2022-04-04]
你真的在你的BB上安装了libstdc ++ 6,ia32-libs吗? 它看起来像x86 lib。 看看Buildroot 。 它已经提供了BB目标,因此您可以非常快速地获得基本的rootfs。 然后只需添加所需的包即可完成。 使用像BR这样的发行版的主要好处是,你在rootfs中都需要依赖,你在microSD卡上刻录。 BR还提供Eclipse插件 。 I thought abi used was arm-linux-gnueabi but when i got the details of abi v ... -
我搜索了头文件,看到了他们的定义。 我在项目头文件中添加了他们的定义并完成了编译 I searched through the header files and saw their definitions. I added their definition in my project header files and the compilation completed
-
一种方法是这样,如下所示。 我希望这些照片能够自我解释。 显示的模型是子系统A,采样时间为1s,原子系统是子系统B,采样时间为10s。 (请在另一个标签中打开图片以查看全尺寸型号) 这会产生以下信号,我相信这就是你所追求的。 One way to do this would be like this shown below. I hope the pictures are self-explaining. The model which is shown is subsystem A, with a sam ...
-
与库交叉编译(Cross-compilation with libraries)[2023-02-18]
最后,我做了以下工作: 我已将库源文件复制到我的目标平台(Altera De_nano_SoC ARM)并在那里编译库(Angstrom Linux,编译器arm-angstrom-linux-gnueabi)。 这需要在库文件夹中设置配置文件,并运行make和make install命令。 编译完成后,我将输出文件(头文件* .h和静态库文件* .a或共享库文件* .so - 取决于编译配置 )复制到我的主机(Windows 7)。 然后我将这些文件添加到我的Eclipse DS-5项目中。 Eclips ... -
可能,您获得的错误是由于单独的头文件定义,最重要的是x86架构的不同共享库文件和PowerPC体系结构的不同头文件。 您可以使用“-I”标志更改头文件定义,使用PowerPC体系结构的共享库文件路径更改头文件定义,可以使用-L选项进行更改。 但是这些所有更改都可能在Makefile中实现,所以你只需要改变不同标志中的位置,比如LDFLAG,CFLAGS等。 Probably, the error you are getting is due to the separate header file defin ...
-
您可以查看Linux上的交叉编译wxWidgets应用程序 (Code :: Blocks wiki)和Linux下的交叉编译 (wxWiki)。 在Brent W. Woodruff C ++ wxWidgets简介中还有一个关于交叉编译Windows应用程序的部分。 You could have a look at Cross Compiling wxWidgets Applications on Linux (Code::Blocks wiki) and Cross-Compiling Under L ...
-
并非所有库都有特定的步骤列表。 你必须以不同的方式设置PoDoFo,你只需要坐下来做它。 在最方便的方面(即使用库),该过程可能涉及为库创建Xcode项目并将其设置为构建为框架。 这对于iOS来说相当简单,因为您只能静态链接到平台上的第三方库。 因此,它主要只是建立一个项目来构建框架,添加相关文件和编译器/链接器标志,以及在必要时设置框架对框架的可见性。 对于其他库,您可以更改CFLAGS / CPPFLAGS / CXXFLAGS / LDFLAGS并从命令行构建静态库。 这不太方便,但最终会产生大致相同 ...
-
在Trusty你可以apt-get xcb ,或者你想要开发人员的东西libx11-xcb-dev 。 看这里: https://packages.ubuntu.com/trusty/libx11-xcb-dev 您可以在那里使用搜索功能来解决这些问题。 In Trusty you can apt-get xcb, or if you want the developer stuff libx11-xcb-dev . See here: https://packages.ubuntu.com/trusty/ ...