0

Is there a way to convert this javascript code to jQuery?

document.writeln('Nu te teme, căci Eu sunt cu tine; nu te uita cu îngrijorare, căci Eu sunt Dumnezeul tău; Eu te întăresc, tot Eu îţi vin în ajutor. Eu te sprijin cu dreapta Mea biruitoare.”');
document.write('<a onclick="var w=window.open(this.href);w.focus();return false;" href="http://biblia.resursecrestine.ro/citeste/isaia/41">Isaia 41:10</a>');

In joomla 1.5 i was able to insert the above javascript; not anymore in joomla 1.6. This needs to be converted in jQuery somehow.

3
  • Can you explain why you'll need to convert this? Commented Apr 16, 2011 at 5:44
  • because the above listed code is not accepted in joomla 1.6 enviroment, they aonly take jquerry and i have no clue how to convert the above code in jquerry, that is why i need help converting Commented Apr 16, 2011 at 5:56
  • you do realize that jQuery is JavaScript? Commented Apr 16, 2011 at 6:03

2 Answers 2

1

In jQuery, the idea is to locate where you want to put what and insert it:

$("mydiv").append("bla bla bla");

Sign up to request clarification or add additional context in comments.

2 Comments

+1 But I think the answer could be slightly more refined with also considering the semantics/ramifications of document.write (which is a very ... unique ... function). In particular, it is relatively hard to locate "an arbitrary position of the document" outside of nodes / node edges (in general text, for instance). Also consider the timing (time, not speed) of insertion.
Thanks, you're right but there isn't enough data as to where/how he was using this line of javascript, so I am just pointing him to the right paradigm instead.
1

I think that you need a better understanding of the Joomla framework. I know nothing about it, but by simply reading the changelist, I was able to gather that Joomla doesn't (by default) incorporate jQuery, they've adopted Mootools.

Asking a question (repeatedly, and a vague one at that) with zero understanding of the actual problem will more times than not lead you in the wrong direction.

So, my advice is to do a little more research on the framework you're using and maybe some on Javascript as well. In doing so, you might also figure out the answer yourself.

4 Comments

I am trying to get better on jquery since the javasript code i use to work with in joomla 1.5 is not acceptablae anymore in joomla 1.6 and I THOUGHT BY POSTING THE JAVASCRIPT CODE HERE SOMEBODY WILL POINT ME TO A CONVERSION IN JQUERY
Yelling doesn't help anyone. My point is you should figure out why it doesn't work in Joomla 1.6 anymore. There could be a reason that has absolutely nothing to do with whether or not it's using jQuery. If you're simply trying to get better using jQuery, then state that in your question and not that it is a requirement of your upgrade to Joomla 1.6.
is there an equivalent fot his javascript code <script type="text/javascript" src="resursecrestine.ro/web-api-versetul-zilei"></script> to do it in jquery?
I give up. I'm starting to think that this thread is a troll.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.