首页 \ 问答 \ 如何生成'a href =“javascript:void(0)”'像cakephp中的链接?(How to generate 'a href=“javascript:void(0)”' like link in cakephp?)

如何生成'a href =“javascript:void(0)”'像cakephp中的链接?(How to generate 'a href=“javascript:void(0)”' like link in cakephp?)

如何生成'a href =“javascript:void(0)”'像CakePHP中的链接?

我创建了一个应用程序,当用户单击图像列表时,内容将插入到编辑器textarea中。 我在这些图像中添加了一个类,并在javascript文件中编写了一些代码。 一切进行得都很顺利。

但是图像的链接是一个URL地址,但不像URL那样'href =“javascript:void(0)'。任何人都可以告诉我如何在CakePHP中创建它?

提前致谢!


How to generate 'a href="javascript:void(0)"' like link in CakePHP?

I make an application, the content will insert into the editor textarea when user click a list of image. I add a class to these images and write some code in the javascript file. Everything is going well.

But the link of the image is a URL address, but not 'href="javascript:void(0)' like URL. Anyone could tell me how to make it in CakePHP?

Thanks in advance!


原文:https://stackoverflow.com/questions/7278278
更新时间:2023-11-28 13:11

最满意答案

然后你需要写

string *array = new string("value");

虽然你最好使用

string array = "value";

因为这是使用它的预期方式。 否则你需要跟踪记忆。


you would then need to write

string *array = new string("value");

although you are better off using

string array = "value";

as that is the intended way to use it. otherwise you need to keep track of memory.

相关问答

更多
  • Segfault可能由许多事情引起。 你是否检查malloc之后的指针(如果它是NULL)? 逐步查看代码的行数,确切了解它发生的位置(并通过更多细节和代码提出一个单独的问题) 你似乎没有理解C中指针和数组的关系。首先,指向数组指针的指针被定义为type***或type** []。 实际上,只有两次间接指针是有用的。 尽管如此,你可以拥有这样的东西,只需引用足够的指针并进行实际的内存分配即可。 这很混乱。 应该是一个单独的问题。 他们很可能会崩溃你的程序,但这是不确定的,所以你不能确定。 他们可能有一个已经 ...
  • 这是怎么做的: func Initialize(v interface{}) { rv := reflect.ValueOf(v).Elem() rv.Set(reflect.New(rv.Type().Elem())) } 必须使用指向要设置的值的指针调用此函数: Initialize(&val) 操场的例子 如果参数类型不是指向指针的指针,则此答案中的代码会发生混乱。 根据您的使用情况,您可能需要在调用Elem()之前检查反射值 类型 。 Here's how to do it: func ...
  • 请记住,C中的字符串由空终止符字符结束 ,写为\0 。 如果在指针变量中存储了格式正确的字符串,则可以通过搜索此字符来确定长度: char *x = "hello"; // automatically appends a null terminator int len = 0; while (x[len] != '\0') { len++; } 如果你的变量未初始化或者格式不正确(例如,通过为NULL ),你显然不能采用这种方法; 但是,大多数函数通常是在字符串格式正确的假设下编写的,因为这会导致 ...
  • 这应该这样做: char **array = malloc(1 * sizeof *array); array[0] = NULL; 这假设分配成功,您应该在实际代码中依赖它之前测试它。 1表示“1个元素的数组”,它当然是多余的,但我觉得它增加了一些清晰度。 上面声明了一个指向(数组)字符指针的指针,并尝试为1这样的字符指针分配空间。 实际上这样做似乎毫无意义,但我无法理解你的想法,想弄你应该做些什么。 :) This should do it: char **array = malloc(1 * siz ...
  • 然后你需要写 string *array = new string("value"); 虽然你最好使用 string array = "value"; 因为这是使用它的预期方式。 否则你需要跟踪记忆。 you would then need to write string *array = new string("value"); although you are better off using string array = "value"; as that is the intended way ...
  • 如果您发布实际错误会有所帮助,但是,您的类型错误,所以这可能是问题所在。 相反,尝试: static const char* new_var = array[0]; Would be helpful if you posted the actual error, but, your types were wrong, so that's probably the problem. Instead, try: static const char* new_var = array[0];
  • user_str : String(1..50) := (others => Character'Val(0)); 要么 user_str : String(1..50) := (others => Ada.Characters.Latin_1.NUL); 与其他一些语言不同,Ada没有特殊的语法来将特定字符嵌入到字符或字符串文字中(例如C的'\0' )。 (当然后者需要适当with条款。) user_str : String(1..50) := (others => Character'Val(0)) ...
  • 除非指定给变量,否则指针不可寻址。 将复合文字的地址不分配给变量的能力仅限于结构体,数组,切片和贴图。 要做你想做的事情,你必须首先将指针分配给一个变量,之后你可以在结构体文本中指定该变量(指针)的地址: https://play.golang.org/p/7WyS732H3cZ package main type atype struct { val string } func main() { at := &atype{ val: "test", } ...
  • char *ptr = "Hello OP!!"; ptr是指向存储在RODATA段中的字符串文字的第一个char的指针。 当您取消引用它时,您只能读取而不能写入值,因为字符串文字是常量字符数组。 char arr[] = "Hello OP!! How are you my friend?"; 在这种情况下: 是为大小文字长度的arr数组分配空间,包括尾随零。 字符串文字被复制到为arr数组分配的空间中 在这种情况下,arr用作内存中复制字符串文字的位置。 您可以读写,因为arr元素是可读写的 现在回 ...
  • 实际上,无论使用第一个还是第二个选项,都与数组本身无关。 第二个选项不会导致任何更改,即使数组是可变的并且您在索引1处替换了对象。 string仍将指向原始对象。 在您给出的示例中,两个选项的选择仅在实际中,您从数组中获取的字符串是NSMutableString 。 如果字符串是不可变的NSString那么任一选项都会给出相同的结果。 但是如果你实际上有一个可变的NSMutableString ,那么选项2意味着你的string值可以随着时间的推移而改变,对可变字符串的另一个引用会改变字符串。 例: NSM ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。